Skip to content

Commit 8084e77

Browse files
committed
Refactor GitHub Actions workflows: remove scheduled trigger from deploy.yml and create scheduled-deploy.yml for daily redeploys; update permissions in sync-to-web.yml
1 parent d3d202d commit 8084e77

3 files changed

Lines changed: 25 additions & 3 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ on:
55
branches:
66
- web
77
workflow_dispatch:
8-
schedule:
9-
# Run once a day at 03:00 UTC to refresh GitHub data and redeploy
10-
- cron: '0 3 * * *'
118

129
permissions:
1310
contents: read
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Scheduled deploy
2+
3+
on:
4+
schedule:
5+
# Run once a day at 03:00 UTC to refresh GitHub data and redeploy
6+
- cron: '0 3 * * *'
7+
8+
permissions:
9+
actions: write
10+
11+
jobs:
12+
trigger:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Dispatch deploy on web branch
16+
uses: actions/github-script@v7
17+
with:
18+
script: |
19+
await github.rest.actions.createWorkflowDispatch({
20+
owner: context.repo.owner,
21+
repo: context.repo.repo,
22+
workflow_id: 'deploy.yml',
23+
ref: 'web'
24+
})

.github/workflows/sync-to-web.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88

99
permissions:
1010
contents: write
11+
actions: write
1112

1213
jobs:
1314
sync:

0 commit comments

Comments
 (0)