Feat: use yarn rather npm #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 Page | |
on: | |
push: | |
branches: ['master'] | |
pull_request: | |
branches: ['master'] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16.x] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'yarn' # Cache Yarn dependencies | |
- run: yarn install # Use Yarn for dependency installation | |
- run: yarn build --if-present # Use Yarn for building | |
- run: yarn test # Use Yarn for running tests | |
- name: Deploy with gh-pages | |
run: | | |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git | |
yarn run deploy -- -u "github-actions-bot <[email protected]>" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |