Skip to content

fix update to ci

fix update to ci #52

Workflow file for this run

name: CI Workflow
on:
pull_request:
push:
branches: [ main ]
jobs:
build:
name: Build Application
runs-on: ubuntu-latest
steps:
- name: Checkout Source
uses: actions/checkout@v4
- name: Cache Node Modules
id: cache-npm
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
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 }}-
- name: List Node Modules State
if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
continue-on-error: true
run: npm list
- name: Install Deps
working-directory: site
run: npm install
- name: Run Linting & Formatting Checks
working-directory: site
run: |
npm run lint &&
npm run format
- name: Build Application
working-directory: site
run: npm run build
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: output
path: site/out
- name: Deploy Application
if: github.ref == 'refs/heads/main'
working-directory: site
run: |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
npm run deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}