-
Notifications
You must be signed in to change notification settings - Fork 13
32 lines (28 loc) · 1.11 KB
/
trigger-deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: Trigger deploy after merges to main
on:
push:
branches: [main]
jobs:
merge-commits-trigger-deploy:
runs-on: ubuntu-latest
permissions:
actions: write # be able to trigger another workflow
contents: write # to merge commits into latest branch
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Merge main -> latest to trigger a deploy on latest
uses: devmasx/merge-branch@854d3ac71ed1e9deb668e0074781b81fdd6e771f # v1.4.0
with:
type: now
from_branch: main
target_branch: latest
github_token: ${{ secrets.GITHUB_TOKEN }}
# We manually run here because github will not execute github actions as a result of commits being pushed to latest branch.
- name: Trigger deploy
uses: aurelien-baudet/workflow-dispatch@3133c5d135c7dbe4be4f9793872b6ef331b53bc7 # v4
id: deploy-action
with:
workflow: deployment.yml
wait-for-completion: false
ref: latest # run the workflow on latest branch so deploy happens on it.
token: ${{ secrets.GITHUB_TOKEN }}