build: run docker release on branches (#130)

This commit is contained in:
Ludvig Lundgren 2022-02-09 19:11:49 +01:00 committed by GitHub
parent fe06363530
commit bdbdab1f18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,8 +2,11 @@ name: docker
on:
push:
branches:
- "master"
- "develop"
tags:
- '*'
- 'v*'
permissions:
packages: write
@ -19,24 +22,27 @@ jobs:
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
- name: Extract metadata
id: meta
uses: docker/metadata-action@v3
with:
images: ghcr.io/autobrr/autobrr
- name: Build and publish image
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: |
ghcr.io/autobrr/autobrr:${{ env.TAG }}
ghcr.io/autobrr/autobrr:latest
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}