-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathazure-static-web-apps-gentle-bay-009857f10.yml
More file actions
65 lines (55 loc) · 2 KB
/
Copy pathazure-static-web-apps-gentle-bay-009857f10.yml
File metadata and controls
65 lines (55 loc) · 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
name: Azure Static Web Apps CI/CD
on:
push:
branches: [ main ]
pull_request:
types: [opened, synchronize, reopened, closed]
branches: [ main ]
jobs:
build_and_deploy_job:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v3
with:
submodules: true
lfs: false
# Se você não precisa de nada de Node aqui, pode remover os 2 passos abaixo.
- name: Install OIDC Client from Core Package
run: npm install @actions/core@1.6.0 @actions/http-client
- name: Get Id Token
uses: actions/github-script@v6
id: idtoken
with:
script: |
const coredemo = require('@actions/core')
return await coredemo.getIDToken()
result-encoding: string
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_GENTLE_BAY_009857F10 }}
action: "upload"
# Caminho onde está seu index.html
app_location: "/"
# Se não há API (Azure Functions), deixe vazio
api_location: ""
# PULE o build do app/API
skip_app_build: true
skip_api_build: true
# Quando pulamos o build, o output é a própria app_location.
# Em muitos exemplos deixa-se vazio:
output_location: ""
# Se você manteve o passo "Get Id Token"
github_id_token: ${{ steps.idtoken.outputs.result }}
close_pull_request_job:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
steps:
- uses: Azure/static-web-apps-deploy@v1
with:
action: "close"