Refine deployment workflow conditions and clean up Docker build process. Update deploy.yml to restrict deployment triggers to main and staging branches, and remove unnecessary sticky disk setup in docker-build-server.yml.

This commit is contained in:
dal 2025-08-21 14:35:34 -06:00
parent c7cc610d73
commit 30cf0c5892
No known key found for this signature in database
GPG Key ID: 16F4B0E1E9F61122
2 changed files with 4 additions and 10 deletions

View File

@ -5,11 +5,10 @@ on:
workflows: ["Build and Push Server Docker Image"]
types:
- completed
branches: [main, staging]
jobs:
deploy:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
if: ${{ github.event.workflow_run.conclusion == 'success' && (github.event.workflow_run.head_branch == 'main' || github.event.workflow_run.head_branch == 'staging') }}
runs-on: blacksmith-2vcpu-ubuntu-2404
environment: ${{ github.event.workflow_run.head_branch == 'main' && 'production' || 'staging' }}

View File

@ -59,12 +59,6 @@ jobs:
key: ${{ github.repository }}-turbo-cache
path: ./.turbo
- name: Mount Docker buildkit sticky disk
uses: useblacksmith/stickydisk@v1
with:
key: ${{ github.repository }}-buildkit-cache
path: /tmp/.buildkit-cache
- name: Install dependencies
run: |
echo "📦 Installing dependencies with pnpm..."
@ -99,7 +93,7 @@ jobs:
# Install production dependencies only
cd /tmp/prod-deps
pnpm install --frozen-lockfile --prod --ignore-scripts --no-optional
pnpm install --frozen-lockfile --prod --no-optional
# Copy back to workspace
cd -
@ -108,7 +102,7 @@ jobs:
cp -r apps/server/dist docker-context/
cp apps/server/package.json docker-context/
- name: Set up Docker Builder with Blacksmith cache
- name: Set up Docker Builder
uses: useblacksmith/setup-docker-builder@v1
- name: Log in to GitHub Container Registry
@ -150,6 +144,7 @@ jobs:
build-args: |
COMMIT_SHA=${{ steps.meta.outputs.sha_short }}
BUILD_DATE=${{ steps.meta.outputs.timestamp }}
platforms: linux/amd64
- name: Output image details
run: |