Update build pipeline to automatically tag docker releases

This commit is contained in:
David Bomba 2025-08-29 14:52:55 +10:00
parent 90e825662e
commit 73b2ac8279
1 changed files with 67 additions and 0 deletions

View File

@ -80,3 +80,70 @@ jobs:
files: | files: |
/home/runner/work/invoiceninja/invoiceninja.tar /home/runner/work/invoiceninja/invoiceninja.tar
/home/runner/work/invoiceninja/invoiceninja.tar.gz /home/runner/work/invoiceninja/invoiceninja.tar.gz
- name: Octane Branch Dockerfiles tag
if: startsWith(github.ref, 'refs/tags/')
run: |
# Extract tag name from ref (e.g., refs/tags/v1.0.0 -> 1.0.0)
TAG_NAME=${GITHUB_REF#refs/tags/}
# Remove leading 'v' from tag name
DOCKER_TAG_NAME="${TAG_NAME#v}-o"
# Create release in dockerfiles repo using GitHub API
curl -X POST \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/turbo124/dockerfiles/releases \
-d "{
\"tag_name\": \"$DOCKER_TAG_NAME\",
\"name\": \"$DOCKER_TAG_NAME\",
\"target_commitish\": \"octane\",
\"body\": \"Automated release triggered by main repo release $TAG_NAME\",
\"draft\": false,
\"prerelease\": false
}"
- name: Debian Branch Dockerfiles tag
if: startsWith(github.ref, 'refs/tags/')
run: |
# Extract tag name from ref (e.g., refs/tags/v1.0.0 -> 1.0.0)
TAG_NAME=${GITHUB_REF#refs/tags/}
# Remove leading 'v' from tag name
DOCKER_TAG_NAME="${TAG_NAME#v}-d"
# Create release in dockerfiles repo using GitHub API
curl -X POST \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/turbo124/dockerfiles/releases \
-d "{
\"tag_name\": \"$DOCKER_TAG_NAME\",
\"name\": \"$DOCKER_TAG_NAME\",
\"target_commitish\": \"debian\",
\"body\": \"Automated release triggered by main repo release $TAG_NAME\",
\"draft\": false,
\"prerelease\": false
}"
- name: Master Branch Dockerfiles tag
if: startsWith(github.ref, 'refs/tags/')
run: |
# Extract tag name from ref (e.g., refs/tags/v1.0.0 -> 1.0.0)
TAG_NAME=${GITHUB_REF#refs/tags/}
# Remove leading 'v' from tag name
DOCKER_TAG_NAME="${TAG_NAME#v}"
# Create release in dockerfiles repo using GitHub API
curl -X POST \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/turbo124/dockerfiles/releases \
-d "{
\"tag_name\": \"$DOCKER_TAG_NAME\",
\"name\": \"$DOCKER_TAG_NAME\",
\"target_commitish\": \"master\",
\"body\": \"Automated release triggered by main repo release $TAG_NAME\",
\"draft\": false,
\"prerelease\": false
}"