-
Notifications
You must be signed in to change notification settings - Fork 26
47 lines (46 loc) · 1.47 KB
/
publish.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
name: Publish website
on:
push:
branches: [ gh-pages-edit ]
# schedule:
# - cron: '0 0 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 13.x
- name: Installing dependencies
run: |
cd tools
npm install
- name: Complementing site data
run: |
cd tools
export YOUTUBE_API_KEY=${{ secrets.YOUTUBE_API_KEY }}
npm run update 2>&1 | tee site-data-collection.log
grep '[ERROR]' site-data-collection.log > site-data-collection_errors.log || true
if [ -s site-data-collection_errors.log ]; then
echo "::error file=tools/main.js::`tail -n 20 site-data-collection_errors.log`"
echo ":exclamation: Errors during Complementing site data, please check logs" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
tail -n 20 site-data-collection_errors.log >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
fi
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.66.0'
extended: true
- name: Build website
run: hugo --minify
- name: Setting domain name
run: cp CNAME public/
- name: Deploy website
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: master