mirror of https://github.com/buster-so/buster.git
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:
parent
c7cc610d73
commit
30cf0c5892
|
@ -5,11 +5,10 @@ on:
|
||||||
workflows: ["Build and Push Server Docker Image"]
|
workflows: ["Build and Push Server Docker Image"]
|
||||||
types:
|
types:
|
||||||
- completed
|
- completed
|
||||||
branches: [main, staging]
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
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
|
runs-on: blacksmith-2vcpu-ubuntu-2404
|
||||||
environment: ${{ github.event.workflow_run.head_branch == 'main' && 'production' || 'staging' }}
|
environment: ${{ github.event.workflow_run.head_branch == 'main' && 'production' || 'staging' }}
|
||||||
|
|
||||||
|
|
|
@ -59,12 +59,6 @@ jobs:
|
||||||
key: ${{ github.repository }}-turbo-cache
|
key: ${{ github.repository }}-turbo-cache
|
||||||
path: ./.turbo
|
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
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
echo "📦 Installing dependencies with pnpm..."
|
echo "📦 Installing dependencies with pnpm..."
|
||||||
|
@ -99,7 +93,7 @@ jobs:
|
||||||
|
|
||||||
# Install production dependencies only
|
# Install production dependencies only
|
||||||
cd /tmp/prod-deps
|
cd /tmp/prod-deps
|
||||||
pnpm install --frozen-lockfile --prod --ignore-scripts --no-optional
|
pnpm install --frozen-lockfile --prod --no-optional
|
||||||
|
|
||||||
# Copy back to workspace
|
# Copy back to workspace
|
||||||
cd -
|
cd -
|
||||||
|
@ -108,7 +102,7 @@ jobs:
|
||||||
cp -r apps/server/dist docker-context/
|
cp -r apps/server/dist docker-context/
|
||||||
cp apps/server/package.json 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
|
uses: useblacksmith/setup-docker-builder@v1
|
||||||
|
|
||||||
- name: Log in to GitHub Container Registry
|
- name: Log in to GitHub Container Registry
|
||||||
|
@ -150,6 +144,7 @@ jobs:
|
||||||
build-args: |
|
build-args: |
|
||||||
COMMIT_SHA=${{ steps.meta.outputs.sha_short }}
|
COMMIT_SHA=${{ steps.meta.outputs.sha_short }}
|
||||||
BUILD_DATE=${{ steps.meta.outputs.timestamp }}
|
BUILD_DATE=${{ steps.meta.outputs.timestamp }}
|
||||||
|
platforms: linux/amd64
|
||||||
|
|
||||||
- name: Output image details
|
- name: Output image details
|
||||||
run: |
|
run: |
|
||||||
|
|
Loading…
Reference in New Issue