Skip to content
This repository was archived by the owner on Apr 11, 2025. It is now read-only.

Commit 6f62725

Browse files
committed
add azure.yml
1 parent 7da69b6 commit 6f62725

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/azure.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Deploy to Azure Static Web Apps
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types: [opened, synchronize, reopened, closed]
9+
branches:
10+
- main
11+
12+
jobs:
13+
build_and_deploy_job:
14+
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
15+
runs-on: ubuntu-latest
16+
name: Build and Deploy Job
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
submodules: true
21+
lfs: false
22+
- name: Build And Deploy
23+
id: builddeploy
24+
uses: Azure/static-web-apps-deploy@v1
25+
with:
26+
azure_static_web_apps_api_token: ${{ secrets.AZURE_DEPLOY_TOKEN }}
27+
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
28+
action: 'upload'
29+
# https://aka.ms/swaworkflowconfig
30+
app_location: './' # NOTE: becomes CWD for the image!
31+
output_location: 'build/static' # relative to app_location
32+
api_location: 'build/server'
33+
34+
close_pull_request_job:
35+
if: github.event_name == 'pull_request' && github.event.action == 'closed'
36+
runs-on: ubuntu-latest
37+
name: Close Pull Request Job
38+
steps:
39+
- name: Close Pull Request
40+
id: closepullrequest
41+
uses: Azure/static-web-apps-deploy@v1
42+
with:
43+
azure_static_web_apps_api_token: ${{ secrets.AZURE_DEPLOY_TOKEN }}
44+
action: 'close'

0 commit comments

Comments
 (0)