Deploy to GitHub Pages #17
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: Deploy to GitHub Pages | |
on: | |
pull_request: | |
branches: [develop] | |
workflow_dispatch: | |
defaults: | |
run: | |
working-directory: frontend | |
jobs: | |
checkout_and_install: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Install jq | |
run: sudo apt-get install jq | |
- name: Clear npm cache | |
run: npm cache clean --force | |
- name: Retry npm install with legacy peer deps | |
run: npm install --legacy-peer-deps | |
- name: Update dependencies | |
run: npm update | |
build: | |
runs-on: ubuntu-latest | |
needs: checkout_and_install | |
steps: | |
- name: Build | |
run: npm run build | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy | |
run: | | |
git config --global user.name $user_name | |
git config --global user.email $user_email | |
git remote set-url origin https://${github_token}@github.com/${repository} | |
npm run deploy | |
env: | |
user_name: 'github-actions[bot]' | |
user_email: 'github-actions[bot]@users.noreply.github.com' | |
github_token: ${{ secrets.ACTIONS_DEPLOY_ACCESS_TOKEN }} | |
repository: ${{ github.repository }} |