@@ -32,24 +32,27 @@ jobs:
3232 uses : docker/setup-buildx-action@v1
3333
3434 - name : Log in to Azure Container Registry
35+
3536 uses : azure/docker-login@v2
3637 with :
3738 login-server : ${{ secrets.ACR_LOGIN_SERVER }}
3839 username : ${{ secrets.ACR_USERNAME }}
3940 password : ${{ secrets.ACR_PASSWORD }}
4041
42+
4143 - name : Set Docker image tag
4244 run : |
43- if [[ "${{ github.ref }}" == "refs/heads/ main" ]]; then
45+ if [[ "${{ github.head. ref }}" == "main" ]]; then
4446 echo "TAG=latest" >> $GITHUB_ENV
45- elif [[ "${{ github.ref }}" == "refs/heads/ dev" ]]; then
47+ elif [[ "${{ github.head. ref }}" == "dev" ]]; then
4648 echo "TAG=dev" >> $GITHUB_ENV
47- elif [[ "${{ github.ref }}" == "refs/heads/ demo" ]]; then
49+ elif [[ "${{ github.head. ref }}" == "demo" ]]; then
4850 echo "TAG=demo" >> $GITHUB_ENV
49- elif [[ "${{ github.ref }}" == "refs/heads/ hotfix" ]]; then
51+ elif [[ "${{ github.head. ref }}" == "hotfix" ]]; then
5052 echo "TAG=hotfix" >> $GITHUB_ENV
5153 fi
5254 - name : Build and push Docker images
55+
5356 run : |
5457 cd src/backend
5558 docker build -t ${{ secrets.ACR_LOGIN_SERVER }}/macaebackend:${{ env.TAG }} -f Dockerfile . && \
5962 docker build -t ${{ secrets.ACR_LOGIN_SERVER }}/macaefrontend:${{ env.TAG }} -f Dockerfile . && \
6063 docker push ${{ secrets.ACR_LOGIN_SERVER }}/macaefrontend:${{ env.TAG }} && \
6164 echo "Frontend image built and pushed successfully."
65+
6266
0 commit comments