Template Updated #58
Workflow file for this run
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 Push Docker Image | |
on: | |
pull_request: | |
types: [closed] | |
branches: | |
- main | |
workflow_dispatch: # Add this line to enable manual triggering | |
jobs: | |
build-and-push: | |
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Log in to Azure Container Registry | |
uses: azure/docker-login@v1 | |
with: | |
login-server: ${{ secrets.ACR_LOGIN_SERVER }} | |
username: ${{ secrets.ACR_USERNAME }} | |
password: ${{ secrets.ACR_PASSWORD }} | |
- name: Build and push Docker image | |
run: | | |
docker build -t ${{ secrets.ACR_LOGIN_SERVER }}/webapp:latest -f WebApp.Dockerfile . | |
docker push ${{ secrets.ACR_LOGIN_SERVER }}/webapp:latest |