make ci/cd action only when new release
This commit is contained in:
parent
9994403925
commit
40c012523d
1 changed files with 4 additions and 16 deletions
|
|
@ -1,11 +1,9 @@
|
|||
name: Docker
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
tags:
|
||||
- 'v*'
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
|
@ -15,12 +13,7 @@ jobs:
|
|||
|
||||
- name: Set image tag
|
||||
id: meta
|
||||
run: |
|
||||
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
|
||||
echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "TAG=latest" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Login to Forgejo registry
|
||||
uses: docker/login-action@v3
|
||||
|
|
@ -37,8 +30,3 @@ jobs:
|
|||
run: |
|
||||
docker push git.sinfonie.org/sinfonie/photo26:${{ steps.meta.outputs.TAG }}
|
||||
|
||||
- name: Tag latest (for master)
|
||||
if: github.ref == 'refs/heads/master'
|
||||
run: |
|
||||
docker tag git.sinfonie.org/sinfonie/photo26:${{ steps.meta.outputs.TAG }} git.sinfonie.org/sinfonie/photo26:latest
|
||||
docker push git.sinfonie.org/sinfonie/photo26:latest
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue