@@ -13,21 +13,17 @@ jobs:
1313 name : Build and Deploy
1414 runs-on : ubuntu-latest
1515 steps :
16- - name : Check out code
16+ - name : Checkout code
1717 uses : actions/checkout@v3
1818
19- - uses : azure/login@v1
20- with :
21- creds : ${{ secrets.AZ_CREDENTIALS }}
22-
23- - name : Login to Azure Container Registry
19+ - name : Azure Container Registry login
2420 uses : docker/login-action@v2
2521 with :
2622 registry : ${{ secrets.AZ_REGISTRY_URL }}
2723 username : ${{ secrets.AZ_REGISTRY_USERNAME }}
2824 password : ${{ secrets.AZ_REGISTRY_PASSWORD }}
2925
30- - name : Build, tag, and push image to Azure Container Instances
26+ - name : Build, tag and push image to Azure Container Registry
3127 env :
3228 SERVICE_ACCOUNT_KEY : ${{ secrets.SERVICE_ACCOUNT_KEY }}
3329 ENV_FILE : ${{ secrets.ENV }}
@@ -36,22 +32,12 @@ jobs:
3632 run : |
3733 echo $SERVICE_ACCOUNT_KEY | base64 --decode > serviceAccountKey.json
3834 echo $ENV_FILE | base64 --decode > .env
39- docker build --target production -t $ECR_REGISTRY/$ECR_REPOSITORY:${{ github.sha }} .
35+ docker build --target ${{ env.CURRENT_ENV }} -t $ECR_REGISTRY/$ECR_REPOSITORY:${{ github.sha }} .
4036 docker push $ECR_REGISTRY/$ECR_REPOSITORY:${{ github.sha }}
4137
42- - name : Deploy to Azure Container Instances
43- uses : azure/aci-deploy@v1
44- env :
45- ECR_REPOSITORY : collaction-api-${{ env.CURRENT_ENV }}
38+ - name : Deploy to Azure App Service
39+ uses : azure/webapps-deploy@v2
4640 with :
47- resource-group : ${{ secrets.AZ_RESOURCE_GROUP }}
48- dns-name-label : ${{ env.CURRENT_ENV }}-api
49- image : ${{ secrets.AZ_REGISTRY_URL }}/${{ env.ECR_REPOSITORY }}:${{ github.sha }}
50- registry-login-server : ${{ secrets.AZ_REGISTRY_URL }}
51- registry-username : ${{ secrets.AZ_REGISTRY_USERNAME }}
52- registry-password : ${{ secrets.AZ_REGISTRY_PASSWORD }}
53- cpu : 1
54- memory : 2.0
55- name : ${{ env.ECR_REPOSITORY }}
56- location : ' west europe'
57- ports : ' 80 443 3000'
41+ app-name : ' collaction-api-${{ env.CURRENT_ENV }}'
42+ publish-profile : ${{ secrets.AZ_PUBLISH_PROFILE }}
43+ images : ' ${{ secrets.AZ_REGISTRY_URL }}/collaction-api-${{ env.CURRENT_ENV }}:${{ github.sha }}'
0 commit comments