π§ WIP #3
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: 'Build and Deploy Webpage' | |
on: ['push'] | |
jobs: | |
build-and-deploy: | |
runs-on: 'ubuntu-latest' | |
steps: | |
- name: Install Chrome | |
uses: browser-actions/setup-chrome@latest | |
- name: 'Checkout ποΈ' | |
uses: 'actions/checkout@v2' # 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 | |
- uses: 'actions/setup-node@v2' | |
with: | |
node-version: '12.22' | |
cache: 'npm' | |
- name: 'Install Packages' | |
run: 'npm install' | |
- name: 'Lint' | |
run: 'npm run lint' | |
- name: 'Test' | |
run: 'npm run test' | |
- name: 'Build' | |
run: 'NODE_ENV=production npm run build' | |
- name: 'Render PDF' | |
run: 'npm run render-pdf' | |
- name: 'Export' | |
run: 'npm run export' | |
- name: 'Add nojekyll file' | |
run: 'touch "out/.nojekyll"' # fixes missing style | |
- name: 'Deploy π' | |
uses: 'JamesIves/github-pages-deploy-action@v4.2.2' | |
if: "(github.ref_name == 'main' || github.ref_name == 'master')" | |
with: | |
branch: 'gh-pages' # The branch the action should deploy to. | |
commit-message: 'π release' | |
folder: 'out' # The folder the action should deploy. | |
ssh-key: '${{ secrets.SSH_DEPLOY_KEY }}' |