Skip to content

Deploy to Github Pages #291

Deploy to Github Pages

Deploy to Github Pages #291

Workflow file for this run

# Simple workflow for deploying static content to GitHub Pages
name: Deploy to Github Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ['main']
# Runs every day at midnight
schedule:
- cron: '0 0 * * *'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Allow one concurrent deployment
concurrency:
group: 'pages'
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
pages: write
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node v16
uses: actions/setup-node@v3
with:
node-version: 16
- name: yarn install
run: yarn install
- name: Fetch data
run: node fetch-data.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ORG_NAME: graasp
OUT_PATH: './src/generated/data.json'
- name: CRA build
run: yarn build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build