ex3 hint 2 tweak #59
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and deploy container image to Azure Web Apps | |
on: | |
push: | |
branches: | |
- master | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v3 | |
- | |
name: 'Login via Azure CLI' | |
uses: azure/login@v1 | |
with: | |
client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
- | |
name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- | |
name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./vulnerable-application | |
file: ./vulnerable-application/Dockerfile | |
push: true | |
tags: ${{ secrets.DOCKER_USERNAME }}/vulnerable-application:latest | |
- | |
name: Deploy to Azure Web Apps | |
uses: azure/webapps-deploy@v2 | |
with: | |
app-name: 'nerdschool-intro-to-web-sec' | |
images: 'index.docker.io/${{ secrets.DOCKER_USERNAME }}/vulnerable-application:latest' |