-
Notifications
You must be signed in to change notification settings - Fork 7
45 lines (39 loc) · 1.25 KB
/
azure-static-web-apps-deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Deploy
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- main
jobs:
build_and_deploy:
if: ${{ github.actor != 'dependabot[bot]' && github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') }}
runs-on: ubuntu-latest
name: Build and deploy
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Build and deploy to Azure
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 }}
action: 'upload'
# App source code path
app_location: '/'
# Built app content directory
output_location: 'dist'
cleanup_pull_request:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
name: Cleanup pull request
steps:
- name: Close Azure deployment
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }}
action: 'close'