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
|
name: Docker
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
release:
|
||||||
branches:
|
types:
|
||||||
- master
|
- published
|
||||||
tags:
|
|
||||||
- 'v*'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
@ -15,12 +13,7 @@ jobs:
|
||||||
|
|
||||||
- name: Set image tag
|
- name: Set image tag
|
||||||
id: meta
|
id: meta
|
||||||
run: |
|
run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
||||||
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
|
|
||||||
echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
|
||||||
else
|
|
||||||
echo "TAG=latest" >> $GITHUB_OUTPUT
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Login to Forgejo registry
|
- name: Login to Forgejo registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
|
|
@ -37,8 +30,3 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
docker push git.sinfonie.org/sinfonie/photo26:${{ steps.meta.outputs.TAG }}
|
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