Build and deploy on GitHub Pages #303
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 on GitHub Pages | |
on: | |
push: | |
branches: | |
- source | |
pull_request: | |
branches: | |
- source | |
schedule: | |
- cron: '0 3 1 * *' # monthly | |
jobs: | |
build: | |
name: Build and deploy on GitHub Pages | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Reconfigure git to use HTTP authentication | |
# see https://github.com/actions/setup-node/issues/214#issuecomment-810829250 for why this is needed | |
run: > | |
git config --global url."https://github.com/".insteadOf | |
ssh://[email protected]/ | |
- name: Use Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 12.x | |
- name: Install NPM dependencies | |
run: npm ci | |
- name: Check formatting using Prettier | |
run: npm run prettier-check | |
- name: Check Dependency Cruiser rules | |
run: npm run depcruise-check | |
- name: Build | |
run: npm run build | |
- name: Deploy | |
uses: JamesIves/github-pages-deploy-action@releases/v3 | |
if: ${{ github.event_name == 'push' }} | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
BRANCH: gh-pages | |
FOLDER: build |