-
Notifications
You must be signed in to change notification settings - Fork 79
63 lines (63 loc) · 1.85 KB
/
Copy pathbuilder.yml
File metadata and controls
63 lines (63 loc) · 1.85 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: build
on:
# schedule:
# - cron: "0 4 * * *"
workflow_dispatch: ~
pull_request:
workflow_run:
workflows: ["wakatime"]
branches: [master]
types:
- completed
jobs:
sync:
name: Sync from notion
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
with:
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Clean the old post
run: |
rm -rf ./content/*
- name: notion-site
uses: nonacosa/notion-site@master
env:
NOTION_SECRET : ${{ secrets.NOTION_SECRET }}
- name: Commit files
run: |
git submodule update --init --recursive
git submodule update --remote --recursive
git config user.email "action@github.com"
git config user.name "GitHub Actions"
git add --all
git commit -m "New results"
git config pull.rebase false
git pull
git push
- name: Format documents
uses: creyD/prettier_action@v3.1
with:
prettier_options: --write ./content/**/*.md
commit_message: 'notion-site: update articles (auto)'
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: 'latest'
extended: true
- uses: actions/cache@v2
with:
path: /tmp/hugo_cache
key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-hugomod-
- name: Build
run: hugo --minify
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public