Skip to content

Commit 42cc0bd

Browse files
committed
ci: add push event trigger and refine deployment conditions in preview.yml for improved deployment handling
1 parent 9a7a13c commit 42cc0bd

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

.github/workflows/preview.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,26 @@ env:
33
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
44
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
55
ALIASES: ${{ vars.ALIASES }}
6-
COMMENT_TRIGGER_OK: github.event_name == 'issue_comment' && contains(github.event.comment.body, '/deploy') && github.event.issue.pull_request != null
7-
PULL_TRIGGER_OK: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
86
on:
97
issue_comment:
108
types: [created]
119
pull_request:
10+
push:
1211
jobs:
1312
deploy:
1413
runs-on: ubuntu-latest
15-
# todo skip already created deploys on that commit
16-
if: vars.COMMENT_TRIGGER_OK || vars.PULL_TRIGGER_OK
14+
if: >-
15+
(
16+
(
17+
github.event_name == 'issue_comment' &&
18+
contains(github.event.comment.body, '/deploy') &&
19+
github.event.issue.pull_request != null
20+
) ||
21+
(
22+
github.event_name == 'pull_request' &&
23+
contains(fromJSON(vars.AUTO_DEPLOY_PRS), github.event.pull_request.number)
24+
)
25+
)
1726
permissions:
1827
pull-requests: write
1928
steps:

0 commit comments

Comments
 (0)