Skip to content

Merge pull request #13 from Rayder-23/iteration-5 #34

Merge pull request #13 from Rayder-23/iteration-5

Merge pull request #13 from Rayder-23/iteration-5 #34

Workflow file for this run

name: Deploy to GitHub Pages
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
# 👇 Build steps
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 20.x
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build
run: |
echo "Building with backend URL: ${{ secrets.REACT_APP_BACKEND_URL }}"
echo "REACT_APP_BACKEND_URL=${{ secrets.REACT_APP_BACKEND_URL }}" > .env.production
cat .env.production # Debug: show the created file
npm run build
env:
REACT_APP_BACKEND_URL: ${{ secrets.REACT_APP_BACKEND_URL }}
# 👆 Build steps
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# 👇 Specify build output path
path: build
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4