This repository was archived by the owner on Mar 14, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -6,19 +6,24 @@ permissions:
6
6
packages : write
7
7
8
8
on :
9
- workflow_dispatch :
10
9
push :
11
10
branches :
12
11
- main
13
12
workflow_run :
14
13
workflows : ["CI"]
14
+ branches : [main] # Only run on CI completion for main branch
15
15
types :
16
16
- completed
17
17
18
18
jobs :
19
19
deploy-production :
20
20
name : Deploy to production
21
- if : github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch'
21
+ # Only deploy if either:
22
+ # 1. Direct push to main
23
+ # 2. CI workflow completed successfully on main branch
24
+ if : |
25
+ (github.event_name == 'push' && github.ref == 'refs/heads/main') ||
26
+ (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main')
22
27
concurrency :
23
28
group : production_environment
24
29
cancel-in-progress : true
28
33
timeout-minutes : 20
29
34
steps :
30
35
- uses : actions/checkout@v4
36
+ with :
37
+ ref : main # Explicitly checkout main branch
31
38
32
39
- uses : ./.github/workflows/setup
33
40
name : Setup
You can’t perform that action at this time.
0 commit comments