Merge pull request 'ci: database CI catchup — local buildx cache + dev tag trigger' (#153) from ci/database-ci-catchup into main
All checks were successful
Build Docker Image / build (push) Successful in 7m53s
All checks were successful
Build Docker Image / build (push) Successful in 7m53s
This commit is contained in:
commit
6a217f97ee
@ -1,11 +1,13 @@
|
||||
# Gitea Actions: Docker Build, Push, and Notify
|
||||
#
|
||||
# CI/CD pipeline for Paper Dynasty Database API:
|
||||
# - Triggered by pushing a CalVer tag (e.g., 2026.3.11)
|
||||
# - Builds Docker image and pushes to Docker Hub with version + production tags
|
||||
# - Triggered by pushing a CalVer tag (e.g., 2026.3.11) or "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 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
|
||||
|
||||
@ -13,10 +15,14 @@ on:
|
||||
push:
|
||||
tags:
|
||||
- '20*' # matches CalVer tags like 2026.3.11
|
||||
- 'dev' # dev environment builds
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
volumes:
|
||||
- pd-buildx-cache:/opt/buildx-cache
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
@ -32,6 +38,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,9 +60,14 @@ jobs:
|
||||
push: true
|
||||
tags: |
|
||||
manticorum67/paper-dynasty-database:${{ steps.version.outputs.version }}
|
||||
manticorum67/paper-dynasty-database:production
|
||||
cache-from: type=registry,ref=manticorum67/paper-dynasty-database:buildcache
|
||||
cache-to: type=registry,ref=manticorum67/paper-dynasty-database:buildcache,mode=max
|
||||
manticorum67/paper-dynasty-database:${{ steps.version.outputs.environment }}
|
||||
cache-from: type=local,src=/opt/buildx-cache/pd-database
|
||||
cache-to: type=local,dest=/opt/buildx-cache/pd-database-new,mode=max
|
||||
|
||||
- name: Rotate cache
|
||||
run: |
|
||||
rm -rf /opt/buildx-cache/pd-database
|
||||
mv /opt/buildx-cache/pd-database-new /opt/buildx-cache/pd-database
|
||||
|
||||
- name: Build Summary
|
||||
run: |
|
||||
@ -61,7 +77,7 @@ jobs:
|
||||
echo "" >> $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:production\`" >> $GITHUB_STEP_SUMMARY
|
||||
echo "- \`manticorum67/paper-dynasty-database:${{ steps.version.outputs.environment }}\`" >> $GITHUB_STEP_SUMMARY
|
||||
echo "" >> $GITHUB_STEP_SUMMARY
|
||||
echo "**Build Details:**" >> $GITHUB_STEP_SUMMARY
|
||||
echo "- Commit: \`${{ steps.version.outputs.sha_short }}\`" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
Loading…
Reference in New Issue
Block a user