-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
903ed0a
commit 77fc997
Showing
4 changed files
with
129 additions
and
39 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Azure Static Web Apps CI/CD | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
types: [opened, synchronize, reopened, closed] | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build_and_deploy_job: | ||
runs-on: ubuntu-latest | ||
name: Build and Deploy Job | ||
permissions: | ||
pull-requests: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
lfs: false | ||
|
||
- name: Create .env file | ||
uses: SpicyPizza/create-envfile@v1 | ||
with: | ||
envkey_REACT_APP_SITE_NAME: ${{ secrets.REACT_APP_SITE_NAME }} | ||
envkey_REACT_APP_REPO_URL: ${{ secrets.REACT_APP_REPO_URL }} | ||
envkey_REACT_APP_API_URL: ${{ secrets.REACT_APP_API_URL }} | ||
|
||
- name: Build And Deploy | ||
id: builddeploy | ||
uses: Azure/static-web-apps-deploy@v1 | ||
with: | ||
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }} | ||
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 your app requirements. ###### | ||
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig | ||
app_location: "/" # App source code path | ||
output_location: "/build" # Built app content directory - optional | ||
###### End of Repository/Build Configurations ###### | ||
|
||
close_pr: | ||
if: github.event_name == 'pull_request' && github.actor == 'dependabot[bot]' | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build_and_deploy_job | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
steps: | ||
- name: Dependabot metadata | ||
id: dependabot-metadata | ||
uses: dependabot/fetch-metadata@v2 | ||
with: | ||
github-token: "${{ secrets.GITHUB_TOKEN }}" | ||
- name: Merge PR | ||
if: steps.dependabot-metadata.outputs.update-type == 'version-update:semver-patch' || steps.dependabot-metadata.outputs.update-type == 'version-update:semver-minor' | ||
run: gh pr merge --auto --merge "$PR_URL" | ||
env: | ||
PR_URL: ${{github.event.pull_request.html_url}} | ||
GH_TOKEN: ${{secrets.GITHUB_TOKEN}} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,25 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", | ||
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"parameters": { | ||
"location": { | ||
"value": "EastUS2" | ||
"resources": [ | ||
{ | ||
"type": "Microsoft.Web/staticSites", | ||
"apiVersion": "2022-09-01", | ||
"name": "bsod-swa", | ||
"location": "East US 2", | ||
"properties": { | ||
"repositoryUrl": "https://github.com/PipeItToDevNull/bsod-api", | ||
"branch": "main", | ||
"buildProperties": { | ||
"appLocation": "/swa", | ||
"outputLocation": "build" | ||
} | ||
}, | ||
"swaName": { | ||
"value": "bsod-swa" | ||
"sku": { | ||
"name": "Free", | ||
"tier": "Free" | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
|