filebrowser/.github/workflows/main.yaml

60 lines
1.7 KiB
YAML
Raw Normal View History

2021-03-04 00:21:05 +00:00
name: main
on:
push:
branches:
- 'main'
2021-03-04 00:21:05 +00:00
jobs:
test:
2021-12-20 21:00:31 +00:00
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
2021-03-04 00:21:05 +00:00
with:
go-version: 1.21.1
- run: cd backend && go test -race -v ./...
2021-12-20 21:00:31 +00:00
lint:
2021-03-04 00:21:05 +00:00
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
2021-03-04 00:21:05 +00:00
with:
go-version: 1.21.1
- run: cd backend && go fmt ./...
push_latest_to_registry:
2021-03-04 00:21:05 +00:00
needs: [lint, test]
name: Push latest
runs-on: ubuntu-latest
2021-03-04 00:21:05 +00:00
steps:
- name: Checkout
uses: actions/checkout@v4
2021-03-04 00:21:05 +00:00
- name: Set up QEMU
uses: docker/setup-qemu-action@v3.0.0
2021-03-04 00:21:05 +00:00
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.0.0
# Workaround to fix error:
# failed to push: failed to copy: io: read/write on closed pipe
# See https://github.com/docker/build-push-action/issues/761
with:
driver-opts: |
image=moby/buildkit:v0.10.6
- name: Login to Docker Hub
uses: docker/login-action@v3
2021-03-04 00:21:05 +00:00
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: gtstef/filebrowser
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64,linux/arm/v7
file: ./Dockerfile
push: true
tags: 'gtstef/filebrowser:latest'
labels: ${{ steps.meta.outputs.labels }}