Skip to content

Commit fca0cc5

Browse files
Migrated to automatic tagging
1 parent 9a91de2 commit fca0cc5

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

.github/workflows/main.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ name: Docker Build & Push
44

55
on:
66
push:
7-
tags:
8-
- "*"
7+
branches:
8+
- main
99
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab
1010

1111
env:
@@ -33,9 +33,11 @@ jobs:
3333
if: success()
3434
id: prepare
3535
run: |
36-
echo "docker_platform=${DOCKER_TARGET_PLATFORM}" >> $GITHUB_OUTPUT
37-
echo "tag=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT
38-
36+
re="^FROM caddy:([^-]+)"
37+
str=$(cat Dockerfile)
38+
tag=$(if [[ $str =~ $re ]]; then echo ${BASH_REMATCH[1]}; else exit 1; fi)
39+
echo "tag=$tag" >> $GITHUB_OUTPUT
40+
3941
- name: Login to Docker Hub
4042
uses: docker/login-action@v3
4143
with:
@@ -69,3 +71,8 @@ jobs:
6971
ghcr.io/${{ env.DOCKER_USERNAME }}/${{ env.DOCKER_CONTAINER_NAME }}:latest
7072
quay.io/${{ env.DOCKER_USERNAME }}/${{ env.DOCKER_CONTAINER_NAME }}:${{ steps.prepare.outputs.tag }}
7173
quay.io/${{ env.DOCKER_USERNAME }}/${{ env.DOCKER_CONTAINER_NAME }}:latest
74+
75+
- name: Create Release
76+
uses: softprops/action-gh-release@v2
77+
with:
78+
tag_name: ${{ steps.prepare.outputs.tag }}

0 commit comments

Comments
 (0)