mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
build: run docker release on branches (#130)
This commit is contained in:
parent
fe06363530
commit
bdbdab1f18
1 changed files with 17 additions and 11 deletions
28
.github/workflows/docker.yml
vendored
28
.github/workflows/docker.yml
vendored
|
@ -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 }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue