File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # This workflow build and push a Docker container to Google Artifact Registry and deploy it on Cloud Run when a commit is pushed to the "main" branch
2+
3+ name : Build and Deploy to Azure Registry
4+
5+ on : push
6+ env :
7+ AZURE_WEBAPP_NAME : threatshield # set this to your application's name
8+
9+ jobs :
10+ build-and-deploy-to-dev :
11+ runs-on : ubuntu-latest
12+ environment : dev
13+ steps :
14+ - uses : actions/checkout@v3
15+ - name : Azure authentication
16+ uses : azure/login@v1
17+ with :
18+ creds : ${{ secrets.AZURE_CREDENTIALS }}
19+ - name : " Build and push image"
20+ uses : azure/docker-login@v1
21+ with :
22+ login-server : ${{ secrets.REGISTRY_LOGIN_SERVER }}
23+ username : ${{ secrets.REGISTRY_USERNAME }}
24+ password : ${{ secrets.REGISTRY_PASSWORD }}
25+ - run : |
26+ docker build . -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/threatshield:${{ github.sha }}
27+ docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/threatshield:${{ github.sha }}
28+
29+ - name : " Deploy to Azure Container Instances"
30+ uses : " azure/aci-deploy@v1"
31+ with :
32+ cpu : 1
33+ memory : 1
34+ resource-group : ${{ secrets.RESOURCE_GROUP }}
35+ registry-login-server : ${{ secrets.REGISTRY_LOGIN_SERVER }}
36+ registry-username : ${{ secrets.REGISTRY_USERNAME }}
37+ registry-password : ${{ secrets.REGISTRY_PASSWORD }}
38+ name : ${{ env.AZURE_WEBAPP_NAME }}
39+ dns-name-label : threatshield-demo
40+ image : ${{ secrets.REGISTRY_LOGIN_SERVER }}/threatshield:${{ github.sha }}
41+ location : ${{ secrets.CONTAINER_INSTANCES_LOCATION }}
You can’t perform that action at this time.
0 commit comments