Skip to content

Commit a30fc52

Browse files
committed
adding windows zone pivot without includes
1 parent bd5df5a commit a30fc52

File tree

2 files changed

+185
-0
lines changed

2 files changed

+185
-0
lines changed

articles/app-service/deploy-container-github-action.md

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ ms.custom: github-actions-azure, devx-track-azurecli, linux-related-content
88
ms.devlang: azurecli
99
author: cephalin
1010
ms.author: cephalin
11+
zone_pivot_groups: app-service-containers-github-actions
1112
---
1213

1314
# Deploy a custom container to App Service using GitHub Actions
@@ -182,6 +183,8 @@ Define secrets to use with the Docker Login action. The example in this document
182183

183184
## Build the Container image
184185

186+
::: zone pivot="github-actions-containers-linux"
187+
185188
The following example show part of the workflow that builds a Node.js Docker image. Use [Docker Login](https://github.com/azure/docker-login) to log into a private container registry. This example uses Azure Container Registry but the same action works for other registries.
186189

187190

@@ -234,6 +237,59 @@ jobs:
234237
docker push mycontainer.azurecr.io/myapp:${{ github.sha }}
235238
```
236239

240+
::: zone-end
241+
242+
::: zone pivot="github-actions-containers-windows"
243+
244+
The following example shows part of the workflow that builds a Windows Docker image. Use [Docker Login](https://github.com/azure/docker-login) to log into a private container registry. This example uses Azure Container Registry but the same action works for other registries.
245+
246+
247+
```yaml
248+
name: Windows Container Workflow
249+
on: [push]
250+
jobs:
251+
build:
252+
runs-on: windows-latest
253+
steps:
254+
- uses: actions/checkout@v2
255+
- uses: azure/docker-login@v1
256+
with:
257+
login-server: mycontainer.azurecr.io
258+
username: ${{ secrets.REGISTRY_USERNAME }}
259+
password: ${{ secrets.REGISTRY_PASSWORD }}
260+
- run: |
261+
docker build . -t mycontainer.azurecr.io/myapp:${{ github.sha }}
262+
docker push mycontainer.azurecr.io/myapp:${{ github.sha }}
263+
```
264+
265+
You can also use [Docker sign-in](https://github.com/azure/docker-login) to log into multiple container registries at the same time. This example includes two new GitHub secrets for authentication with docker.io. The example assumes that there's a Dockerfile at the root level of the registry.
266+
267+
```yml
268+
name: Windows Container Workflow
269+
on: [push]
270+
jobs:
271+
build:
272+
runs-on: windows-latest
273+
steps:
274+
- uses: actions/checkout@v2
275+
- uses: azure/docker-login@v1
276+
with:
277+
login-server: mycontainer.azurecr.io
278+
username: ${{ secrets.REGISTRY_USERNAME }}
279+
password: ${{ secrets.REGISTRY_PASSWORD }}
280+
- uses: azure/docker-login@v1
281+
with:
282+
login-server: index.docker.io
283+
username: ${{ secrets.DOCKERIO_USERNAME }}
284+
password: ${{ secrets.DOCKERIO_PASSWORD }}
285+
- run: |
286+
docker build . -t mycontainer.azurecr.io/myapp:${{ github.sha }}
287+
docker push mycontainer.azurecr.io/myapp:${{ github.sha }}
288+
```
289+
290+
::: zone-end
291+
292+
237293
## Deploy to an App Service container
238294

239295
To deploy your image to a custom container in App Service, use the `azure/webapps-deploy@v2` action. This action has seven parameters:
@@ -250,6 +306,8 @@ To deploy your image to a custom container in App Service, use the `azure/webapp
250306

251307
# [Publish profile](#tab/publish-profile)
252308

309+
::: zone pivot="github-actions-containers-linux"
310+
253311
```yaml
254312
name: Linux Container Node Workflow
255313
@@ -362,6 +420,124 @@ jobs:
362420
az logout
363421
```
364422

423+
::: zone-end
424+
425+
::: zone pivot="github-actions-containers-windows"
426+
427+
```yaml
428+
name: Windows_Container_Workflow
429+
430+
on: [push]
431+
432+
jobs:
433+
build:
434+
runs-on: windows-latest
435+
436+
steps:
437+
- uses: actions/checkout@v2
438+
439+
- uses: azure/docker-login@v1
440+
with:
441+
login-server: mycontainer.azurecr.io
442+
username: ${{ secrets.REGISTRY_USERNAME }}
443+
password: ${{ secrets.REGISTRY_PASSWORD }}
444+
445+
- run: |
446+
docker build . -t mycontainer.azurecr.io/myapp:${{ github.sha }}
447+
docker push mycontainer.azurecr.io/myapp:${{ github.sha }}
448+
449+
- uses: azure/webapps-deploy@v2
450+
with:
451+
app-name: 'myapp'
452+
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
453+
images: 'mycontainer.azurecr.io/myapp:${{ github.sha }}'
454+
```
455+
456+
# [Service principal](#tab/service-principal)
457+
458+
```yaml
459+
on: [push]
460+
461+
name: Windows_Container_Workflow
462+
463+
jobs:
464+
build-and-deploy:
465+
runs-on: windows-latest
466+
steps:
467+
# checkout the repo
468+
- name: 'Checkout GitHub Action'
469+
uses: actions/checkout@main
470+
471+
- name: 'Sign in via Azure CLI'
472+
uses: azure/login@v1
473+
with:
474+
creds: ${{ secrets.AZURE_CREDENTIALS }}
475+
476+
- uses: azure/docker-login@v1
477+
with:
478+
login-server: mycontainer.azurecr.io
479+
username: ${{ secrets.REGISTRY_USERNAME }}
480+
password: ${{ secrets.REGISTRY_PASSWORD }}
481+
- run: |
482+
docker build . -t mycontainer.azurecr.io/myapp:${{ github.sha }}
483+
docker push mycontainer.azurecr.io/myapp:${{ github.sha }}
484+
485+
- uses: azure/webapps-deploy@v2
486+
with:
487+
app-name: 'myapp'
488+
images: 'mycontainer.azurecr.io/myapp:${{ github.sha }}'
489+
490+
- name: Azure logout
491+
run: |
492+
az logout
493+
```
494+
495+
# [OpenID Connect](#tab/openid)
496+
497+
```yaml
498+
on: [push]
499+
name: Windows_Container_Workflow
500+
501+
permissions:
502+
id-token: write
503+
contents: read
504+
505+
jobs:
506+
build-and-deploy:
507+
runs-on: windows-latest
508+
steps:
509+
# checkout the repo
510+
- name: 'Checkout GitHub Action'
511+
uses: actions/checkout@main
512+
513+
- name: 'Sign in via Azure CLI'
514+
uses: azure/login@v1
515+
with:
516+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
517+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
518+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
519+
520+
- uses: azure/docker-login@v1
521+
with:
522+
login-server: mycontainer.azurecr.io
523+
username: ${{ secrets.REGISTRY_USERNAME }}
524+
password: ${{ secrets.REGISTRY_PASSWORD }}
525+
- run: |
526+
docker build . -t mycontainer.azurecr.io/myapp:${{ github.sha }}
527+
docker push mycontainer.azurecr.io/myapp:${{ github.sha }}
528+
529+
- uses: azure/webapps-deploy@v2
530+
with:
531+
app-name: 'myapp'
532+
images: 'mycontainer.azurecr.io/myapp:${{ github.sha }}'
533+
534+
- name: Azure logout
535+
run: |
536+
az logout
537+
```
538+
539+
::: zone-end
540+
365541
---
366542

367543
## Next steps

articles/zone-pivot-groups.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -781,6 +781,15 @@ groups:
781781
title: Java
782782
- id: openai-node
783783
title: Node
784+
# Owner: jefmarti
785+
- id: app-service-containers-github-actions
786+
title: App Service GitHub actions
787+
prompt: Choose a platform
788+
pivots:
789+
- id: github-actions-containers-linux
790+
title: Linux
791+
- id: github-actions-containers-windows
792+
title: Windows
784793
# Owner: msangapu
785794
- id: app-spaces-component-types
786795
title: App Spaces components

0 commit comments

Comments
 (0)