Update description #14
This file contains 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
# Workflow for deploying a React Vite app to GitHub Pages | |
name: Deploy React Vite App to Pages | |
on: | |
# Runs on pushes targeting the default branch (e.g., master or main) | |
push: | |
branches: ["master"] # Update this if your default branch is "master" | |
# Allows manual triggering of the workflow from the Actions tab | |
workflow_dispatch: | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Allow only one concurrent deployment | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
# Single deploy job | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Checkout repository content | |
- name: Checkout repository content | |
uses: actions/checkout@v4 | |
# Step 2: Set up Node.js environment | |
- name: Set up Node.js environment | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
cache: 'npm' | |
# Step 3: Install dependencies and build the project | |
- name: Install dependencies and build project | |
run: | | |
npm ci | |
npm run build | |
# Step 4: Upload artifact (compiled files in `dist` folder) | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: 'dist' # Path to the folder containing compiled files | |
# Step 5: Deploy to GitHub Pages | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |