File tree 2 files changed +12
-76
lines changed
2 files changed +12
-76
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -4,8 +4,8 @@ name: Docker Build & Push
4
4
5
5
on :
6
6
push :
7
- tags :
8
- - " * "
7
+ branches :
8
+ - main
9
9
workflow_dispatch : # Allows you to run this workflow manually from the Actions tab
10
10
11
11
env :
33
33
if : success()
34
34
id : prepare
35
35
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
+
39
41
- name : Login to Docker Hub
40
42
uses : docker/login-action@v3
41
43
with :
69
71
ghcr.io/${{ env.DOCKER_USERNAME }}/${{ env.DOCKER_CONTAINER_NAME }}:latest
70
72
quay.io/${{ env.DOCKER_USERNAME }}/${{ env.DOCKER_CONTAINER_NAME }}:${{ steps.prepare.outputs.tag }}
71
73
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 }}
You can’t perform that action at this time.
0 commit comments