-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (46 loc) · 1.31 KB
/
gh-pages.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
52
53
54
55
56
# 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
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'