-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (35 loc) · 1.11 KB
/
Copy pathazure-web-app.yml
File metadata and controls
44 lines (35 loc) · 1.11 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
# .github/workflows/node-build.yml
name: Deploy to Azure Arquitecture
on:
workflow_call:
jobs:
deploy-azure-static-web-app:
runs-on: ubuntu-latest
name: Static Web App
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: web-build
path: dist
- name: Download json artifact
uses: actions/download-artifact@v4
with:
name: static-web-app-json
path: secret
- name: Install SWA CLI
run: npm install -g @azure/static-web-apps-cli
- name: Deploy Static Web App
run: |
ENV_NAME=$([ "$GITHUB_REF_NAME" = "main" ] && echo "production" || echo "$GITHUB_REF_NAME")
FILE_JSON="secret/static-web-app-json.json"
API_KEY=$(jq -r '.properties.apiKey' $FILE_JSON)
swa deploy ./dist --deployment-token $API_KEY --env $ENV_NAME