ci: add dev tag trigger to Docker build workflow
Some checks are pending
Build Docker Image / build (push) Waiting to run
Some checks are pending
Build Docker Image / build (push) Waiting to run
Allows deploying to dev environment by pushing a "dev" tag. Dev tags build with :dev Docker tag instead of :production. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
0b6e85fff9
commit
d4d93cd95e
@ -1,11 +1,13 @@
|
|||||||
# Gitea Actions: Docker Build, Push, and Notify
|
# Gitea Actions: Docker Build, Push, and Notify
|
||||||
#
|
#
|
||||||
# CI/CD pipeline for Paper Dynasty Database API:
|
# CI/CD pipeline for Paper Dynasty Database API:
|
||||||
# - Triggered by pushing a CalVer tag (e.g., 2026.3.11)
|
# - Triggered by pushing a CalVer tag (e.g., 2026.3.11) or "dev" tag
|
||||||
# - Builds Docker image and pushes to Docker Hub with version + production tags
|
# - CalVer tags push with version + "production" Docker tags
|
||||||
|
# - "dev" tag pushes with "dev" Docker tag for the dev environment
|
||||||
# - Sends Discord notifications on success/failure
|
# - Sends Discord notifications on success/failure
|
||||||
#
|
#
|
||||||
# To release: git tag 2026.3.11 && git push origin 2026.3.11
|
# To release: git tag 2026.3.11 && git push origin 2026.3.11
|
||||||
|
# To deploy dev: git tag -f dev && git push origin dev --force
|
||||||
|
|
||||||
name: Build Docker Image
|
name: Build Docker Image
|
||||||
|
|
||||||
@ -13,6 +15,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- '20*' # matches CalVer tags like 2026.3.11
|
- '20*' # matches CalVer tags like 2026.3.11
|
||||||
|
- 'dev' # dev environment builds
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@ -32,6 +35,11 @@ jobs:
|
|||||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||||
echo "sha_short=$SHA_SHORT" >> $GITHUB_OUTPUT
|
echo "sha_short=$SHA_SHORT" >> $GITHUB_OUTPUT
|
||||||
echo "timestamp=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> $GITHUB_OUTPUT
|
echo "timestamp=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> $GITHUB_OUTPUT
|
||||||
|
if [ "$VERSION" = "dev" ]; then
|
||||||
|
echo "environment=dev" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "environment=production" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: https://github.com/docker/setup-buildx-action@v3
|
uses: https://github.com/docker/setup-buildx-action@v3
|
||||||
@ -49,7 +57,7 @@ jobs:
|
|||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
manticorum67/paper-dynasty-database:${{ steps.version.outputs.version }}
|
manticorum67/paper-dynasty-database:${{ steps.version.outputs.version }}
|
||||||
manticorum67/paper-dynasty-database:production
|
manticorum67/paper-dynasty-database:${{ steps.version.outputs.environment }}
|
||||||
cache-from: type=registry,ref=manticorum67/paper-dynasty-database:buildcache
|
cache-from: type=registry,ref=manticorum67/paper-dynasty-database:buildcache
|
||||||
cache-to: type=registry,ref=manticorum67/paper-dynasty-database:buildcache,mode=max
|
cache-to: type=registry,ref=manticorum67/paper-dynasty-database:buildcache,mode=max
|
||||||
|
|
||||||
@ -61,7 +69,7 @@ jobs:
|
|||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "**Image Tags:**" >> $GITHUB_STEP_SUMMARY
|
echo "**Image Tags:**" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "- \`manticorum67/paper-dynasty-database:${{ steps.version.outputs.version }}\`" >> $GITHUB_STEP_SUMMARY
|
echo "- \`manticorum67/paper-dynasty-database:${{ steps.version.outputs.version }}\`" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "- \`manticorum67/paper-dynasty-database:production\`" >> $GITHUB_STEP_SUMMARY
|
echo "- \`manticorum67/paper-dynasty-database:${{ steps.version.outputs.environment }}\`" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "**Build Details:**" >> $GITHUB_STEP_SUMMARY
|
echo "**Build Details:**" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "- Commit: \`${{ steps.version.outputs.sha_short }}\`" >> $GITHUB_STEP_SUMMARY
|
echo "- Commit: \`${{ steps.version.outputs.sha_short }}\`" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user