Build blog post #1280
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
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
name: Build blog post | |
on: | |
schedule: | |
- cron: "0 0 * * *" # Every day at midnight. | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [14.x] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
steps: | |
- name: Set up Python 3.7 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.7 | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v2.3.2 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly. | |
with: | |
persist-credentials: false | |
- name: Collect posts 😺 | |
env: | |
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }} | |
run: | | |
python3.7 -m venv env | |
source env/bin/activate | |
pip install --upgrade pip | |
pip install -r requirements.txt | |
python3.7 ./bin/get_posts.py | |
- name: Build blog 🔨 | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: | | |
yarn install | |
yarn build | |
yarn export | |
touch ./out/.nojekyll | |
- name: Deploy 🚀 | |
uses: JamesIves/github-pages-deploy-action@3.7.1 | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
BRANCH: gh-pages # The branch the action should deploy to. | |
FOLDER: out # The folder the action should deploy. | |
CLEAN: true # Automatically remove deleted files from the deploy branch |