fix #396
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: github pages | |
on: | |
# schedule: | |
# - cron: "0 0 * * *" # Every day at midnight. | |
workflow_dispatch: | |
push: | |
branches: | |
- master # Set a branch to deploy | |
pull_request: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true # Fetch Hugo themes (true OR recursive) | |
fetch-depth: 0 # Fetch all history for .GitInfo and . | |
persist-credentials: false # follow recommend of notion pull | |
# pull notion blogs | |
- name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built. | |
env: | |
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }} | |
NOTION_ROOT_PAGE_ID: ${{ secrets.NOTION_ROOT_PAGE_ID }} | |
run: | | |
yarn install | |
yarn import-notion-posts | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
hugo-version: 'latest' | |
extended: true | |
- name: Build | |
run: hugo --minify | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
if: github.ref == 'refs/heads/master' | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./public | |