File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 55 types : [closed]
66 branches :
77 - main
8+ - dev
9+ - demo
810 workflow_dispatch : # Add this line to enable manual triggering
911
1012jobs :
2628 username : ${{ secrets.ACR_USERNAME }}
2729 password : ${{ secrets.ACR_PASSWORD }}
2830
31+ - name : Set Docker image tag
32+ id : docker_tag
33+ run : |
34+ if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
35+ echo "TAG=latest" >> $GITHUB_ENV
36+ elif [[ "${{ github.ref }}" == "refs/heads/dev" ]]; then
37+ echo "TAG=dev" >> $GITHUB_ENV
38+ elif [[ "${{ github.ref }}" == "refs/heads/demo" ]]; then
39+ echo "TAG=demo" >> $GITHUB_ENV
40+ fi
41+
2942 - name : Build and push Docker image
3043 run : |
31- docker build -t ${{ secrets.ACR_LOGIN_SERVER }}/webapp:latest -f WebApp.Dockerfile .
32- docker push ${{ secrets.ACR_LOGIN_SERVER }}/webapp:latest
44+ docker build -t ${{ secrets.ACR_LOGIN_SERVER }}/webapp:${{ env.TAG }} -f WebApp.Dockerfile .
45+ docker push ${{ secrets.ACR_LOGIN_SERVER }}/webapp:${{ env.TAG }}
You can’t perform that action at this time.
0 commit comments