-
Notifications
You must be signed in to change notification settings - Fork 23
49 lines (38 loc) · 1.22 KB
/
auto-merge.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Auto merge main into git-pages
on:
push:
branches:
- main
pull_request:
types: [closed]
permissions:
contents: write
jobs:
sync:
if: github.event.pull_request.merged == true || github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Checkout main branch
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Add git-pages remote
run: |
git remote add git-pages https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
- name: Fetch git-pages branch
run: git fetch origin git-pages:git-pages
- name: Checkout git-page branch
run: git checkout git-pages
- name: Merge main into git-pages
run: |
git merge main --no-ff -m "feat: ✨ Auto-merge main into git-pages"
- name: Push changes to git-pages
run: git push origin git-pages
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v3
with:
event-type: git-pages-deploy