Update deploy.yml #10
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
name: Deploy React App to GitHub Pages | |
on: | |
push: | |
branches: | |
- react_ui # Change to your actual branch name | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "18" | |
cache: npm | |
- name: Install Dependencies | |
run: npm install # Use npm install instead of npm ci if lock file issues occur | |
- name: Build Project | |
run: npm run build | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 # Updated to v4 | |
with: | |
name: github-pages | |
path: ./build # Ensure build folder exists before uploading | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Download Artifact | |
uses: actions/download-artifact@v4 # Updated to v4 | |
with: | |
name: github-pages | |
path: ./build # Download the artifact to the correct folder | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 # Ensure you're using the latest version |