diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..410ca0b --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,41 @@ +name: docker + +on: + push: + tags: + - '*' + +permissions: + contents: write + +jobs: + docker: + name: Build and publish Docker images + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Get the tag name + run: echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV + + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + push: true + tags: | + ghcr.io/autobrr/autobrr:${{ env.TAG }} + ghcr.io/autobrr/autobrr:latest + + - name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f9d8487..852291c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,6 +10,7 @@ permissions: jobs: goreleaser: + name: Build and publish Go binaries runs-on: ubuntu-latest steps: @@ -32,7 +33,7 @@ jobs: name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.16 + go-version: 1.17.6 - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 @@ -42,30 +43,3 @@ jobs: args: release --rm-dist env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - docker: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Get the tag name - run: echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV - - - name: Login to GitHub Container Registry - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and push - id: docker_build - uses: docker/build-push-action@v2 - with: - push: true - tags: | - ghcr.io/autobrr/autobrr:${{ env.TAG }} - ghcr.io/autobrr/autobrr:latest diff --git a/Dockerfile b/Dockerfile index ab9bc03..610c67a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,6 +32,8 @@ RUN make -f Makefile build/ctl # build runner FROM alpine:latest +LABEL org.opencontainers.image.source = "https://github.com/autobrr/autobrr" + ENV HOME="/config" \ XDG_CONFIG_HOME="/config" \ XDG_DATA_HOME="/config"