-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (40 loc) · 1.15 KB
/
build_page.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
name: Build page
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'src/*'
permissions:
contents: write
jobs:
build-index:
runs-on: ubuntu-latest
if: github.event.repository.fork == false
steps:
- name: Checkout main
uses: actions/checkout@v4
with:
fetch-depth: 2
ref: 'main'
path: main
- name: Checkout gh-pages
uses: actions/checkout@v4
with:
fetch-depth: 2
ref: 'gh-pages'
path: gh-pages
- name: Copying src
run: cp -r main/src/* gh-pages/
- name: Get last commit message - gh-pages
id: last-commit-message-gh-pages
run: echo "msg=$(git -C gh-pages log -1 --pretty=%s)" >> $GITHUB_OUTPUT
- name: Commit - gh-pages
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: ${{ steps.last-commit-message-gh-pages.outputs.msg }}
commit_options: '--amend --no-edit'
push_options: '--force'
skip_fetch: true
repository: gh-pages