Skip to content

Commit e3d7c41

Browse files
Merge pull request #37 from SlothCroissant/staging
Added automatic tagging, removed deprecated caddyBuilder.ps1
2 parents 7d90573 + fca0cc5 commit e3d7c41

File tree

2 files changed

+12
-76
lines changed

2 files changed

+12
-76
lines changed

.github/workflows/caddyBuilder.ps1

-71
This file was deleted.

.github/workflows/main.yml

+12-5
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)