Skip to content

Updated ci script with mac os runner #15

Updated ci script with mac os runner

Updated ci script with mac os runner #15

Workflow file for this run

# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests
name: ci
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
node-version: [18.x] # can add extra versions later as a list if needed
steps:
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup node env
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
check-latest: true
- name: cache node modules #to speed up creation of files e.g. dependencies
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
name: list the state of node modules
continue-on-error: true
run: npm list
- name: install dependencies
run: npm install
- name: build static pages
run: npm run generate
- name: deploy to github pages
uses: crazy-max/ghaction-github-pages@v4
with:
target_branch: gh-pages
build_dir: .output/public
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}