Skip to content

Fix deploy.yml

Fix deploy.yml #19

Workflow file for this run

# https://dev.to/github/how-to-deploy-a-static-site-in-any-framework-of-your-choice-github-pages-neh
name: Deploy to GitHub Pages
on:
# Trigger the workflow every time you push to the `main` branch
push:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab on GitHub.
workflow_dispatch:
pull_request:
branches: [ main ]
# Allow this job to clone the repo and create a page deployment
permissions:
contents: read
pages: write
id-token: write
jobs:
test-and-build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build project
run: npm run build
env:
NODE_ENV: production
- name: Run tests
uses: cypress-io/github-action@v6
with:
start: npm run preview
wait-on: 'http://localhost:5173'
browser: chrome
config: baseUrl=http://localhost:5173/ab-test-calculator-link/
env:
CYPRESS_BASE_URL: http://localhost:5173/ab-test-calculator-link/

Check failure on line 49 in .github/workflows/deploy.yml

View workflow run for this annotation

GitHub Actions / Deploy to GitHub Pages

Invalid workflow file

The workflow is not valid. .github/workflows/deploy.yml (Line: 49, Col: 13): A mapping was not expected
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./dist
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: test-and-build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4