Files
portfolio/.github/workflows/deploy-test.yml
2024-10-11 15:06:31 +02:00

41 lines
795 B
YAML

name: Deploy to server
on:
push:
branches:
- main
- master
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Install dependencies and build
run: |
npm ci
npm run build
- name: Install http-server
run: npm install --save-dev http-server
- name: Start HTTP server
run: npx http-server ./dist -p 8080 &
env:
CI: true
- name: Run Cypress tests
run: npm run test
env:
CYPRESS_baseUrl: http://localhost:8080