mirror of
https://github.com/jambonz/next-static-site.git
synced 2025-12-19 04:47:44 +00:00
50 lines
1.1 KiB
YAML
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 |