ci: optimize build + deploy + migrate workflows
CI / CI (pull_request) Successful in 31m18s

- build.yaml: merge 3 cargo steps into single compile pass (reuse artifacts)
- build.yaml: remove cargo clean (wasted compiled artifacts before Docker)
- build.yaml: add secret validation for registry credentials
- deploy.yaml: skip checkout, fetch SHA via Gitea API (no clone overhead)
- deploy.yaml: reuse FORGEJO_REGISTRY_TOKEN for API auth (existing privilege)
- deploy.yaml: validate SHA image exists before tagging as latest
- deploy.yaml: add secret validation for registry credentials
- migrate.yaml: merge schema verification into both changed + manual paths
- migrate.yaml: manual trigger now fails on first error (was silently masking)
This commit is contained in:
2026-09-13 09:53:11 +09:00
parent c142ff5109
commit 4fdbb48ae6
3 changed files with 52 additions and 26 deletions
+9 -11
View File
@@ -26,17 +26,11 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
- name: Cargo build all
run: cargo build --all --verbose
- name: Cargo test all
run: cargo test --all --lib --verbose 2>&1 | tail -150 || true
- name: Cargo clippy
run: cargo clippy --all --all-targets -- -D warnings 2>&1 | tail -50 || true
- name: Clean build artifacts before Docker
run: cargo clean
- name: Cargo build, test, clippy (single compile pass)
run: |
cargo build --all --verbose
cargo test --all --lib --verbose 2>&1 | tail -150 || true
cargo clippy --all --all-targets -- -D warnings 2>&1 | tail -50 || true
- name: Get short SHA
id: sha
@@ -44,6 +38,10 @@ jobs:
- name: Registry login
run: |
if [ -z "${REGISTRY_USER}" ] || [ -z "${REGISTRY_TOKEN}" ]; then
echo "ERROR: Missing REGISTRY_USER or REGISTRY_TOKEN secrets"
exit 1
fi
echo "${REGISTRY_TOKEN}" | docker login "${REGISTRY}" \
--username "${REGISTRY_USER}" --password-stdin
env: