Skip to content

chore: Update backendUrl in contactService.js to use REACT_APP_BACKEN… #44

chore: Update backendUrl in contactService.js to use REACT_APP_BACKEN…

chore: Update backendUrl in contactService.js to use REACT_APP_BACKEN… #44

# This workflow will build and push a web application to an Azure Static Web App when you change your code.
#
# This workflow assumes you have already created the target Azure Static Web App.
# For instructions see https://docs.microsoft.com/azure/static-web-apps/get-started-portal?tabs=vanilla-javascript
#
# To configure this workflow:
#
# 1. Set up a secret in your repository named AZURE_STATIC_WEB_APPS_API_TOKEN with the value of your Static Web Apps deployment token.
# For instructions on obtaining the deployment token see: https://docs.microsoft.com/azure/static-web-apps/deployment-token-management
#
# 3. Change the values for the APP_LOCATION, API_LOCATION and APP_ARTIFACT_LOCATION, AZURE_STATIC_WEB_APPS_API_TOKEN environment variables (below).
# For instructions on setting up the appropriate configuration values go to https://docs.microsoft.com/azure/static-web-apps/front-end-frameworks
name: Deploy landing frontend to Azure Static Web Apps
on:
push:
branches: [ "main", "develop" ]
paths: ["landing/**", ".github/workflows/azure-staticwebapp.yml" ]
# pull_request:
# types: [opened, synchronize, reopened, closed]
# branches: [ "develop" ]
# Environment variables available to all jobs and steps in this workflow
env:
APP_LOCATION: "/landing" # location of your client code
# API_LOCATION: "api" # location of your api source code - optional
APP_ARTIFACT_LOCATION: "build" # location of client code build output
AZURE_STATIC_WEB_APPS_API_TOKEN: ${{ secrets.LANDING_AZURE_STATIC_WEB_APPS_API_TOKEN }} # secret containing deployment token for your static web app
permissions:
contents: read
jobs:
build_and_deploy_job:
permissions:
contents: read # for actions/checkout to fetch code
pull-requests: write # for Azure/static-web-apps-deploy to comment on PRs
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: ubuntu-latest
environment: ${{ github.ref_name == 'main' && 'prod' || 'dev' }} # Set the github actions environment name to pick secrets from
name: Build and Deploy Job
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ env.AZURE_STATIC_WEB_APPS_API_TOKEN }} # secret containing api token for app
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
action: "upload"
###### Repository/Build Configurations - These values can be configured to match you app requirements. ######
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
app_location: ${{ env.APP_LOCATION }}
api_location: ${{ env.API_LOCATION }}
app_artifact_location: ${{ env.APP_ARTIFACT_LOCATION }}
app_build_command: 'npm run build' # Static Web App build command to embed environment variables
env: # Add environment variables here
REACT_APP_GA_MEASUREMENT_ID: ${{ secrets.REACT_APP_GA_MEASUREMENT_ID }}
REACT_APP_BACKEND_URL: ${{ vars.LANDING_REACT_APP_BACKEND_URL }}
REACT_APP_ENV: ${{ github.ref_name == 'main' && 'prod' || 'dev' }} # Set the node environment to enable/disable google analytics
###### End of Repository/Build Configurations ######
# close_pull_request_job:
# permissions:
# contents: none
# if: github.event_name == 'pull_request' && github.event.action == 'closed'
# runs-on: ubuntu-latest
# name: Close Pull Request Job
# steps:
# - name: Close Pull Request
# id: closepullrequest
# uses: Azure/static-web-apps-deploy@v1
# with:
# azure_static_web_apps_api_token: ${{ env.AZURE_STATIC_WEB_APPS_API_TOKEN }} # secret containing api token for app
# action: "close"