-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathazure-static-web-apps-purple-stone-01f11a20f.yml
More file actions
128 lines (122 loc) · 5.2 KB
/
Copy pathazure-static-web-apps-purple-stone-01f11a20f.yml
File metadata and controls
128 lines (122 loc) · 5.2 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: Azure Static Web Apps CI/CD
on:
push:
branches:
- main
paths:
- 'frontend/**'
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- main
paths:
- 'frontend/**'
workflow_dispatch:
jobs:
deactivate_deployments_production:
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
name: Deactivate Previous Deployments (Production)
permissions:
deployments: write
steps:
- name: Set Previous Deployements To Inactive
uses: strumwolf/delete-deployment-environment@a4825dd9648c57da8437a4885c3fcad58beac69c # v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
environment: Production - Frontend
onlyDeactivateDeployments: true
deactivate_deployments_preview:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
name: Deactivate Previous Deployments (Preview)
permissions:
deployments: write
steps:
- name: Set Previous Deployements To Inactive
uses: strumwolf/delete-deployment-environment@a4825dd9648c57da8437a4885c3fcad58beac69c # v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
environment: Preview - Frontend
ref: ${{ github.head_ref }}
onlyDeactivateDeployments: true
build_and_deploy_job_production:
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
name: Build and Deploy Job (Production)
needs: deactivate_deployments_production
permissions:
contents: read
pull-requests: write
environment:
name: 'Production - Frontend'
url: ${{ steps.builddeploy.outputs.static_web_app_url }}
env:
VUE_APP_BACKEND_URL: ${{ secrets.BACKEND_URL }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
submodules: true
lfs: false
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@4d27395796ac319302594769cfe812bd207490b1 # v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_PURPLE_STONE_01F11A20F }}
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: "./frontend" # App source code path
api_location: "" # Api source code path - optional
output_location: "dist" # Built app content directory - optional
config_file_location: "./" # Custom configuration files - optional
###### End of Repository/Build Configurations ######
build_and_deploy_job_preview:
if: github.event_name == 'pull_request' && github.event.action != 'closed'
runs-on: ubuntu-latest
name: Build and Deploy Job (Preview)
needs: deactivate_deployments_preview
permissions:
contents: read
pull-requests: write
environment:
name: 'Preview - Frontend'
url: ${{ steps.builddeploy.outputs.static_web_app_url }}
env:
VUE_APP_BACKEND_URL: ${{ secrets.BACKEND_URL }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
submodules: true
lfs: false
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@4d27395796ac319302594769cfe812bd207490b1 # v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_PURPLE_STONE_01F11A20F }}
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: "./frontend" # App source code path
api_location: "" # Api source code path - optional
output_location: "dist" # Built app content directory - optional
config_file_location: "./" # Custom configuration files - optional
###### End of Repository/Build Configurations ######
close_pull_request_job:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
name: Close Pull Request Job
needs: deactivate_deployments_preview
permissions:
pull-requests: write
deployments: write
steps:
- name: Close Pull Request
id: closepullrequest
uses: Azure/static-web-apps-deploy@4d27395796ac319302594769cfe812bd207490b1 # v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_PURPLE_STONE_01F11A20F }}
action: "close"
app_location: "./frontend"