-
Notifications
You must be signed in to change notification settings - Fork 6
51 lines (51 loc) · 1.52 KB
/
notion.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
50
51
name: notion
on:
workflow_dispatch:
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/post/*
- name: notion-site
uses: pkwenda/notion-site@master
env:
NOTION_SECRET : ${{ secrets.NOTION_SECRET }}
- name: Commit files
run: |
git config user.email "action@github.com"
git config user.name "GitHub Actions"
git add --all
git commit -m "New results"
git pull origin main
git push
- name: Format documents
uses: creyD/prettier_action@v3.1
with:
commit_message: 'notion-md-gen: 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