Convert to nextjs #34
Workflow file for this run
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: 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: 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 -- -u "github-actions-bot <[email protected]>" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |