Frontend Azure Static Web App - prod #90
Workflow file for this run
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: Frontend Azure Static Web App | |
run-name: Frontend Azure Static Web App - ${{ github.event.inputs.deploy-env }} | |
on: | |
push: | |
paths: | |
- 'frontend/**' | |
branches: | |
- main | |
pull_request: | |
types: [opened, synchronize, reopened, closed] | |
branches: | |
- main | |
workflow_dispatch: | |
inputs: | |
deploy-env: | |
description: 'Select environment' | |
required: true | |
default: 'int' | |
type: choice | |
options: | |
- int | |
- prod | |
jobs: | |
deploy-int: | |
if: (github.event_name == 'workflow_dispatch' && github.event.inputs.deploy-env == 'int') || github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') | |
runs-on: ubuntu-latest | |
name: ${{ github.event.inputs.deploy-env }} - Build + Deploy to Azure Static Web App | |
environment: | |
name: 'int-frontend' | |
url: ${{ steps.builddeploy.outputs.static_web_app_url }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Build + Upload | |
id: builddeploy | |
uses: Azure/static-web-apps-deploy@v1 | |
with: | |
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_GRAY_BAY_05EF8EE03 }} | |
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments) | |
action: "upload" | |
deployment_environment: ${{ github.event.inputs.deploy-env == 'int' && 'int' || '' }} | |
###### Repository/Build Configurations - These values can be configured to match your app requirements. ###### | |
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig | |
app_location: "./frontend" # App source code path | |
api_location: "./frontend/build/server" # Api source code path - optional | |
output_location: "./build/static" # Built app content directory - optional | |
###### End of Repository/Build Configurations ###### | |
deploy-prod: | |
if: github.event_name == 'workflow_dispatch' && github.event.inputs.deploy-env == 'prod' | |
runs-on: ubuntu-latest | |
name: ${{ github.event.inputs.deploy-env }} - Build + Deploy to Azure Static Web App | |
environment: | |
name: 'prod-frontend' | |
url: ${{ steps.builddeploy.outputs.static_web_app_url }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Build + Upload | |
id: builddeploy | |
uses: Azure/static-web-apps-deploy@v1 | |
with: | |
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_GRAY_BAY_05EF8EE03 }} | |
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments) | |
action: "upload" | |
deployment_environment: ${{ github.event.inputs.deploy-env == 'int' && 'int' || '' }} | |
###### Repository/Build Configurations - These values can be configured to match your app requirements. ###### | |
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig | |
app_location: "./frontend" # App source code path | |
api_location: "./frontend/build/server" # Api source code path - optional | |
output_location: "./build/static" # Built app content directory - optional | |
###### End of Repository/Build Configurations ###### | |
close_pull_request: | |
if: github.event_name == 'pull_request' && github.event.action == 'closed' | |
runs-on: ubuntu-latest | |
name: Delete Environment from Azure Static Web App (PR closed) | |
steps: | |
- name: Close Pull Request | |
id: closepullrequest | |
uses: Azure/static-web-apps-deploy@v1 | |
with: | |
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_GRAY_BAY_05EF8EE03 }} | |
action: "close" |