Skip to content

refactor: Update GitHub Pages deployment workflow to include lazy loa… #32

refactor: Update GitHub Pages deployment workflow to include lazy loa…

refactor: Update GitHub Pages deployment workflow to include lazy loa… #32

name: Build and Publish to GitHub Pages
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '16'
- name: Install dependencies
run: npm install
- name: Build the React app
run: npm run build
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action