Added README note with URL exmaple #31
This file contains hidden or 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
# 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: | |
e2e_specs: | |
name: Cypress specs | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out your repository using git | |
uses: actions/checkout@v3 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
- name: Install dependencies | |
uses: bahmutov/npm-install@v1 | |
- name: Cypress run | |
uses: cypress-io/github-action@v6 | |
with: | |
build: npm run build | |
start: npm run preview | |
wait-on: 'http://localhost:5173' | |
browser: chrome | |
env: | |
CYPRESS_BASE_URL: http://localhost:5173/ab-test-calculator-link/ | |
build: | |
runs-on: ubuntu-latest | |
needs: e2e_specs | |
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: 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: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |