Skip to content

Commit 456eb81

Browse files
committed
yml
1 parent 90f2cbb commit 456eb81

File tree

1 file changed

+23
-22
lines changed

1 file changed

+23
-22
lines changed

.github/workflows/azure-deploy.yml

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
name: Build & Deploy to Azure
1+
name: Build & One-Deploy to Azure
22

3-
# Grant GitHub Actions the ability to mint an OIDC token
43
permissions:
5-
contents: read # for checking out your code
6-
id-token: write # to obtain the AAD OIDC token
4+
contents: read
5+
id-token: write
76

87
on:
98
push:
@@ -14,33 +13,35 @@ jobs:
1413
runs-on: ubuntu-latest
1514

1615
steps:
17-
# 1️⃣ Checkout your code
16+
# 1️⃣ Check out your code
1817
- uses: actions/checkout@v3
1918

20-
# 2️⃣ Use Node 20
19+
# 2️⃣ Authenticate to Azure
20+
- name: Azure Login
21+
uses: azure/login@v1
22+
with:
23+
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_E5978DC6004B4BB995ACD60ADAF513EF }}
24+
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_8824E98435E440FAA46E146AD7716A44 }}
25+
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_6A3ECC57385541ACB3AC40EA396FC5B5 }}
26+
27+
# 3️⃣ Use Node 20 and build
2128
- name: Setup Node.js
2229
uses: actions/setup-node@v3
2330
with:
2431
node-version: "20"
25-
26-
# 3️⃣ Install & build
2732
- name: Install dependencies
2833
run: npm ci
2934
- name: Build
3035
run: npm run build
3136

32-
# 4️⃣ Login to Azure via OIDC (no client secret needed)
33-
- name: Azure Login
34-
uses: azure/login@v1
35-
with:
36-
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_E5978DC6004B4BB995ACD60ADAF513EF }}
37-
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_8824E98435E440FAA46E146AD7716A44 }}
38-
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_6A3ECC57385541ACB3AC40EA396FC5B5 }}
39-
40-
# 5️⃣ Deploy the artifiact to your Web App
41-
- name: Deploy to Azure Web App
42-
uses: azure/webapps-deploy@v2
37+
# 4️⃣ Deploy with Azure CLI’s ZIP-push (OneDeploy under the hood)
38+
- name: Deploy via Azure CLI
39+
uses: azure/cli@v2
4340
with:
44-
app-name: pubsite
45-
package: .
46-
enable-oryx-build: true
41+
azcliversion: latest
42+
inlineScript: |
43+
az webapp deploy \
44+
--resource-group myPortfolioRG \
45+
--name pubsite \
46+
--src-path "${{ github.workspace }}" \
47+
--type zip

0 commit comments

Comments
 (0)