Files
next-static-site/.github/workflows/main.yml
Dave Horton 24f11fa429 wip (#101)
* wip

* wip

* wip

* attempt to fix bug in workflow

* minor
2024-11-19 12:44:29 -05:00

50 lines
1.1 KiB
YAML

name: github
on:
push:
branches:
- 'main'
pull_request:
branches:
- '**'
workflow_dispatch:
jobs:
test:
environment: Production
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Cache node modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Cache Cypress binary
uses: actions/cache@v3
with:
path: ~/.cache/Cypress
key: ${{ runner.os }}-cypress-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-cypress-
- name: Install Dependencies
run: npm install
- name: Install Cypress
run: npx cypress install
- name: Build and Start Next.js
run: npm run build && (npm run start&) > /dev/null
- name: Run Tests
run: npm run test