Skip to content

Commit cb57742

Browse files
authored
Update Azure Static Web Apps workflow configuration
Added options to skip app and API build steps in deployment.
1 parent 98c31b2 commit cb57742

1 file changed

Lines changed: 28 additions & 21 deletions

File tree

.github/workflows/azure-static-web-apps-gentle-bay-009857f10.yml

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,57 +2,64 @@ name: Azure Static Web Apps CI/CD
22

33
on:
44
push:
5-
branches:
6-
- main
5+
branches: [ main ]
76
pull_request:
87
types: [opened, synchronize, reopened, closed]
9-
branches:
10-
- main
8+
branches: [ main ]
119

1210
jobs:
1311
build_and_deploy_job:
1412
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
1513
runs-on: ubuntu-latest
16-
name: Build and Deploy Job
1714
permissions:
18-
id-token: write
19-
contents: read
15+
id-token: write
16+
contents: read
2017
steps:
2118
- uses: actions/checkout@v3
2219
with:
2320
submodules: true
2421
lfs: false
22+
23+
# Se você não precisa de nada de Node aqui, pode remover os 2 passos abaixo.
2524
- name: Install OIDC Client from Core Package
2625
run: npm install @actions/core@1.6.0 @actions/http-client
2726
- name: Get Id Token
2827
uses: actions/github-script@v6
2928
id: idtoken
3029
with:
31-
script: |
32-
const coredemo = require('@actions/core')
33-
return await coredemo.getIDToken()
34-
result-encoding: string
30+
script: |
31+
const coredemo = require('@actions/core')
32+
return await coredemo.getIDToken()
33+
result-encoding: string
34+
3535
- name: Build And Deploy
3636
id: builddeploy
3737
uses: Azure/static-web-apps-deploy@v1
3838
with:
3939
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_GENTLE_BAY_009857F10 }}
4040
action: "upload"
41-
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
42-
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
43-
app_location: "/" # App source code path
44-
api_location: "" # Api source code path - optional
45-
output_location: "." # Built app content directory - optional
41+
42+
# Caminho onde está seu index.html
43+
app_location: "/"
44+
45+
# Se não há API (Azure Functions), deixe vazio
46+
api_location: ""
47+
48+
# PULE o build do app/API
49+
skip_app_build: true
50+
skip_api_build: true
51+
52+
# Quando pulamos o build, o output é a própria app_location.
53+
# Em muitos exemplos deixa-se vazio:
54+
output_location: ""
55+
56+
# Se você manteve o passo "Get Id Token"
4657
github_id_token: ${{ steps.idtoken.outputs.result }}
47-
###### End of Repository/Build Configurations ######
4858

4959
close_pull_request_job:
5060
if: github.event_name == 'pull_request' && github.event.action == 'closed'
5161
runs-on: ubuntu-latest
52-
name: Close Pull Request Job
5362
steps:
54-
- name: Close Pull Request
55-
id: closepullrequest
56-
uses: Azure/static-web-apps-deploy@v1
63+
- uses: Azure/static-web-apps-deploy@v1
5764
with:
5865
action: "close"

0 commit comments

Comments
 (0)