Skip to content

Commit

Permalink
Merge pull request #251 from loftwah/dl/cicd-fix-kamal
Browse files Browse the repository at this point in the history
fix cicd
  • Loading branch information
loftwah authored Dec 10, 2024
2 parents b2d21e3 + 4798659 commit f589d5c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/01.deploy_to_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,24 @@ permissions:
packages: write

on:
workflow_dispatch:
push:
branches:
- main
workflow_run:
workflows: ["CI"]
branches: [main] # Only run on CI completion for main branch
types:
- completed

jobs:
deploy-production:
name: Deploy to production
if: github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch'
# Only deploy if either:
# 1. Direct push to main
# 2. CI workflow completed successfully on main branch
if: |
(github.event_name == 'push' && github.ref == 'refs/heads/main') ||
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main')
concurrency:
group: production_environment
cancel-in-progress: true
Expand All @@ -28,6 +33,8 @@ jobs:
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
ref: main # Explicitly checkout main branch

- uses: ./.github/workflows/setup
name: Setup
Expand Down

0 comments on commit f589d5c

Please sign in to comment.