ci: add dev tag trigger and environment-based image tagging

Adds support for the 'dev' tag to trigger CI builds, pushing :dev Docker
tag for the dev environment. CalVer tags now also push :production alongside
:latest for future migration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Cal Corum 2026-04-08 20:12:45 -05:00
parent f9e24eb4bc
commit 6b957fc61c

View File

@ -1,11 +1,13 @@
# Gitea Actions: Docker Build, Push, and Notify
#
# CI/CD pipeline for Major Domo Database API:
# - Triggered by pushing a CalVer tag (e.g., 2026.4.5)
# - Builds Docker image and pushes to Docker Hub with version + latest tags
# - Triggered by pushing a CalVer tag (e.g., 2026.4.5) or the 'dev' tag
# - 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
#
# To release: git tag -a 2026.4.5 -m "description" && git push origin 2026.4.5
# To test: git tag -f dev && git push -f origin dev
name: Build Docker Image
@ -13,6 +15,7 @@ on:
push:
tags:
- '20*' # matches CalVer tags like 2026.4.5
- 'dev'
jobs:
build:
@ -32,6 +35,11 @@ jobs:
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "sha_short=$SHA_SHORT" >> $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
uses: https://github.com/docker/setup-buildx-action@v3
@ -49,6 +57,7 @@ jobs:
push: true
tags: |
manticorum67/major-domo-database:${{ steps.version.outputs.version }}
manticorum67/major-domo-database:${{ steps.version.outputs.environment }}
manticorum67/major-domo-database:latest
cache-from: type=registry,ref=manticorum67/major-domo-database:buildcache
cache-to: type=registry,ref=manticorum67/major-domo-database:buildcache,mode=max
@ -61,6 +70,7 @@ jobs:
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Image Tags:**" >> $GITHUB_STEP_SUMMARY
echo "- \`manticorum67/major-domo-database:${{ steps.version.outputs.version }}\`" >> $GITHUB_STEP_SUMMARY
echo "- \`manticorum67/major-domo-database:${{ steps.version.outputs.environment }}\`" >> $GITHUB_STEP_SUMMARY
echo "- \`manticorum67/major-domo-database:latest\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Build Details:**" >> $GITHUB_STEP_SUMMARY