Skip to content

Commit 68d7dda

Browse files
change tab order
1 parent 9bdae26 commit 68d7dda

File tree

1 file changed

+35
-49
lines changed

1 file changed

+35
-49
lines changed

articles/static-web-apps/build-configuration.md

Lines changed: 35 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,6 @@ With these settings, you can set up GitHub Actions or [Azure Pipelines](get-star
3232

3333
## File name and location
3434

35-
<!--
36-
::: zone pivot="azure-pipelines"
37-
38-
39-
40-
::: zone-end
41-
42-
::: zone pivot="github-actions"
43-
44-
45-
46-
::: zone-end
47-
-->
48-
4935
::: zone pivot="azure-pipelines"
5036

5137
The GitHub action generates the configuration file and is stored in the *.github/workflows* folder, named using the following format: `azure-static-web-apps-<RANDOM_NAME>.yml`.
@@ -109,7 +95,7 @@ In this configuration:
10995

11096
::: zone pivot="github-actions"
11197

112-
# [GitHub access token](#tab/gat)
98+
# [Azure deployment token](#tab/adt)
11399

114100
```yml
115101
name: Azure Static Web Apps CI/CD
@@ -118,6 +104,7 @@ on:
118104
push:
119105
branches:
120106
- main
107+
- dev
121108
pull_request:
122109
types: [opened, synchronize, reopened, closed]
123110
branches:
@@ -128,21 +115,37 @@ jobs:
128115
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
129116
runs-on: ubuntu-latest
130117
name: Build and Deploy Job
118+
permissions:
119+
id-token: write
120+
contents: read
131121
steps:
132-
- uses: actions/checkout@v2
122+
- uses: actions/checkout@v3
133123
with:
134124
submodules: true
125+
lfs: false
126+
- name: Install OIDC Client from Core Package
127+
run: npm install @actions/[email protected] @actions/http-client
128+
- name: Get Id Token
129+
uses: actions/github-script@v6
130+
id: idtoken
131+
with:
132+
script: |
133+
const coredemo = require('@actions/core')
134+
return await coredemo.getIDToken()
135+
result-encoding: string
135136
- name: Build And Deploy
136137
id: builddeploy
137138
uses: Azure/static-web-apps-deploy@v1
138139
with:
139-
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }}
140-
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for GitHub integrations (i.e. PR comments)
140+
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_GENTLE_WATER }}
141141
action: "upload"
142-
###### Repository/Build Configurations ######
143-
app_location: "src" # App source code path relative to repository root
144-
api_location: "api" # Api source code path relative to repository root - optional
145-
output_location: "public" # Built app content directory, relative to app_location - optional
142+
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
143+
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
144+
app_location: "/" # App source code path
145+
api_location: "" # Api source code path - optional
146+
output_location: "dist/angular-basic" # Built app content directory - optional
147+
production_branch: "dev"
148+
github_id_token: ${{ steps.idtoken.outputs.result }}
146149
###### End of Repository/Build Configurations ######
147150
148151
close_pull_request_job:
@@ -154,11 +157,11 @@ jobs:
154157
id: closepullrequest
155158
uses: Azure/static-web-apps-deploy@v1
156159
with:
157-
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }}
160+
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_GENTLE_WATER_030D91C1E }}
158161
action: "close"
159162
```
160163

161-
# [Azure deployment token](#tab/adt)
164+
# [GitHub access token](#tab/gat)
162165

163166
```yml
164167
name: Azure Static Web Apps CI/CD
@@ -167,7 +170,6 @@ on:
167170
push:
168171
branches:
169172
- main
170-
- dev
171173
pull_request:
172174
types: [opened, synchronize, reopened, closed]
173175
branches:
@@ -178,37 +180,21 @@ jobs:
178180
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
179181
runs-on: ubuntu-latest
180182
name: Build and Deploy Job
181-
permissions:
182-
id-token: write
183-
contents: read
184183
steps:
185-
- uses: actions/checkout@v3
184+
- uses: actions/checkout@v2
186185
with:
187186
submodules: true
188-
lfs: false
189-
- name: Install OIDC Client from Core Package
190-
run: npm install @actions/[email protected] @actions/http-client
191-
- name: Get Id Token
192-
uses: actions/github-script@v6
193-
id: idtoken
194-
with:
195-
script: |
196-
const coredemo = require('@actions/core')
197-
return await coredemo.getIDToken()
198-
result-encoding: string
199187
- name: Build And Deploy
200188
id: builddeploy
201189
uses: Azure/static-web-apps-deploy@v1
202190
with:
203-
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_GENTLE_WATER }}
191+
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }}
192+
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for GitHub integrations (i.e. PR comments)
204193
action: "upload"
205-
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
206-
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
207-
app_location: "/" # App source code path
208-
api_location: "" # Api source code path - optional
209-
output_location: "dist/angular-basic" # Built app content directory - optional
210-
production_branch: "dev"
211-
github_id_token: ${{ steps.idtoken.outputs.result }}
194+
###### Repository/Build Configurations ######
195+
app_location: "src" # App source code path relative to repository root
196+
api_location: "api" # Api source code path relative to repository root - optional
197+
output_location: "public" # Built app content directory, relative to app_location - optional
212198
###### End of Repository/Build Configurations ######
213199
214200
close_pull_request_job:
@@ -220,7 +206,7 @@ jobs:
220206
id: closepullrequest
221207
uses: Azure/static-web-apps-deploy@v1
222208
with:
223-
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_GENTLE_WATER_030D91C1E }}
209+
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }}
224210
action: "close"
225211
```
226212

0 commit comments

Comments
 (0)