fetch-data #138
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: fetch-data | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
schedule: | |
# run on 17:00 every Friday | |
- cron: '0 17 * * Fri' | |
jobs: | |
get-data: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
persist-credentials: false | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
- name: Install dependencies | |
run: yarn install | |
- name: Build /dist | |
run: yarn build | |
- name: Fetch data | |
env: | |
NODE_ENV: production | |
run: yarn start | |
- name: Deploy to GitHub Pages | |
uses: crazy-max/ghaction-github-pages@v2 | |
if: success() | |
with: | |
target_branch: gh-pages | |
build_dir: temp | |
commit_message: 'chore: deploy to GitHub Pages' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |