Skip to content

Commit d2541ce

Browse files
Merge pull request #262869 from vermegi/givermei-appsvc-ghaction
Update deploy-best-practices.md
2 parents 694ec98 + 974a260 commit d2541ce

File tree

1 file changed

+17
-22
lines changed

1 file changed

+17
-22
lines changed

articles/app-service/deploy-best-practices.md

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -65,44 +65,39 @@ App Service has [built-in continuous delivery](deploy-continuous-deployment.md)
6565

6666
### Use GitHub Actions
6767

68-
You can also automate your container deployment [with GitHub Actions](./deploy-ci-cd-custom-container.md). The workflow file below will build and tag the container with the commit ID, push it to a container registry, and update the specified site slot with the new image tag.
68+
You can also automate your container deployment [with GitHub Actions](https://github.com/Azure/webapps-deploy). The workflow file below will build and tag the container with the commit ID, push it to a container registry, and update the specified web app with the new image tag.
6969

7070
```yaml
71-
name: Build and deploy a container image to Azure Web Apps
72-
7371
on:
7472
push:
7573
branches:
7674
- <your-branch-name>
7775

76+
name: Linux_Container_Node_Workflow
77+
7878
jobs:
7979
build-and-deploy:
8080
runs-on: ubuntu-latest
81-
8281
steps:
83-
- uses: actions/checkout@main
84-
85-
-name: Authenticate using a Service Principal
86-
uses: azure/actions/login@v1
87-
with:
88-
creds: ${{ secrets.AZURE_SP }}
82+
# checkout the repo
83+
- name: 'Checkout Github Action'
84+
uses: actions/checkout@main
8985

90-
- uses: azure/container-actions/docker-login@v1
86+
- uses: azure/docker-login@v1
9187
with:
92-
username: ${{ secrets.DOCKER_USERNAME }}
93-
password: ${{ secrets.DOCKER_PASSWORD }}
88+
login-server: contoso.azurecr.io
89+
username: ${{ secrets.REGISTRY_USERNAME }}
90+
password: ${{ secrets.REGISTRY_PASSWORD }}
9491

95-
- name: Build and push the image tagged with the git commit hash
96-
run: |
97-
docker build . -t contoso/demo:${{ github.sha }}
98-
docker push contoso/demo:${{ github.sha }}
92+
- run: |
93+
docker build . -t contoso.azurecr.io/nodejssampleapp:${{ github.sha }}
94+
docker push contoso.azurecr.io/nodejssampleapp:${{ github.sha }}
9995
100-
- name: Update image tag on the Azure Web App
101-
uses: azure/webapps-container-deploy@v1
96+
- uses: azure/webapps-deploy@v2
10297
with:
103-
app-name: '<your-webapp-name>'
104-
slot-name: '<your-slot-name>'
105-
images: 'contoso/demo:${{ github.sha }}'
98+
app-name: 'node-rnc'
99+
publish-profile: ${{ secrets.azureWebAppPublishProfile }}
100+
images: 'contoso.azurecr.io/nodejssampleapp:${{ github.sha }}'
106101
```
107102
108103
### Use other automation providers

0 commit comments

Comments
 (0)