Skip to content

Commit

Permalink
Yml changes
Browse files Browse the repository at this point in the history
  • Loading branch information
aunshx committed Feb 7, 2025
1 parent a696db6 commit 808e899
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions .github/workflows/web-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,47 @@ name: Azure Static Web Apps CI/CD
on:
push:
branches:
- master
- master

jobs:
build_and_deploy_job:
runs-on: ubuntu-latest
name: Build and Deploy Job
env:
CI: false # override CI falg so we don't fail on warnings
REACT_APP_BACKEND_BASE_API: ${{ secrets.REACT_APP_BACKEND_BASE_API }}
REACT_APP_LOCAL_DEVELOPMENT_MODE: ${{ secrets.REACT_APP_LOCAL_DEVELOPMENT_MODE }}

steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: true
lfs: false

- name: Setup Node.js 18
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Debug Environment Variables
- name: Create .env File
run: |
echo "Checking environment variables (values will be masked):"
echo "REACT_APP_BACKEND_BASE_API exists: ${{ env.REACT_APP_BACKEND_BASE_API != '' }}"
echo "REACT_APP_LOCAL_DEVELOPMENT_MODE exists: ${{ env.REACT_APP_LOCAL_DEVELOPMENT_MODE != '' }}"
echo "REACT_APP_BACKEND_BASE_API=${{ secrets.REACT_APP_BACKEND_BASE_API }}" >> .env
echo "REACT_APP_LOCAL_DEVELOPMENT_MODE=${{ secrets.REACT_APP_LOCAL_DEVELOPMENT_MODE }}" >> .env
cat .env # Debugging: Check if .env is created properly (values will be masked)
- name: Install Dependencies
run: npm install

- name: Build And Deploy
- name: Build React App
run: npm run build
env:
REACT_APP_BACKEND_BASE_API: ${{ secrets.REACT_APP_BACKEND_BASE_API }}
REACT_APP_LOCAL_DEVELOPMENT_MODE: ${{ secrets.REACT_APP_LOCAL_DEVELOPMENT_MODE }}

- name: Deploy to Azure Static Web Apps
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_KIND_OCEAN_071A97E1E }}
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for GitHub integrations (i.e. PR comments)
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }}
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for GitHub PR comments
action: "upload"
# Repository/Build Configurations - adjust these to match your app requirements
app_location: "/" # App source code path
app_location: "/" # Adjust if your React app is in a subfolder
api_location: "" # API source code path - optional
output_location: "build" # Built app content directory - optional
env:
REACT_APP_BACKEND_BASE_API: ${{ vars.REACT_APP_BACKEND_BASE_API }}
REACT_APP_LOCAL_DEVELOPMENT_MODE: ${{ vars.REACT_APP_LOCAL_DEVELOPMENT_MODE }}
output_location: "build" # Path to the built React app

0 comments on commit 808e899

Please sign in to comment.