File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build and Push Docker Image
2+
3+ on :
4+ pull_request :
5+ types : [closed]
6+ branches :
7+ - main
8+ workflow_dispatch : # Add this line to enable manual triggering
9+
10+ jobs :
11+ build-and-push :
12+ if : github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch'
13+ runs-on : ubuntu-latest
14+
15+ steps :
16+ - name : Checkout repository
17+ uses : actions/checkout@v2
18+
19+ - name : Set up Docker Buildx
20+ uses : docker/setup-buildx-action@v1
21+
22+ - name : Log in to Azure Container Registry
23+ uses : azure/docker-login@v1
24+ with :
25+ login-server : ${{ secrets.ACR_LOGIN_SERVER }}
26+ username : ${{ secrets.ACR_USERNAME }}
27+ password : ${{ secrets.ACR_PASSWORD }}
28+
29+ - name : Build and push Docker image
30+ run : |
31+ docker build -t ${{ secrets.ACR_LOGIN_SERVER }}/webapp:latest -f WebApp.Dockerfile .
32+ docker push ${{ secrets.ACR_LOGIN_SERVER }}/webapp:latest
You can’t perform that action at this time.
0 commit comments