File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ # ######## Prod Workflow ########
3+ on :
4+ pull_request :
5+ branches : [main]
6+ types :
7+ - closed
8+ workflow_dispatch :
9+ permissions :
10+ id-token : write
11+ contents : read
12+
13+ jobs :
14+ Build :
15+ environment : Production
16+ runs-on : ubuntu-latest
17+ if : github.event.pull_request.merged == true
18+ steps :
19+ - uses : actions/checkout@v2
20+ - uses : azure/docker-login@v1
21+ with :
22+ login-server : ${{ secrets.REGISTRY_DOMAIN }}
23+ username : ${{ secrets.REGISTRY_USERNAME }}
24+ password : ${{ secrets.REGISTRY_PASSWORD }}
25+ - name : Publish image to Azure Registry
26+ run : |
27+ docker build -t ${{ secrets.REGISTRY_DOMAIN }}/${{ secrets.REGISTRY_REPO }}:${{ github.sha }} -t ${{ secrets.REGISTRY_DOMAIN }}/${{ secrets.REGISTRY_REPO }}:${{ github.ref_name == 'master' && 'prod' || github.ref_name }}${{ github.ref_name != 'master' && '-latest' || 'latest' }} .
28+ docker push ${{ secrets.REGISTRY_DOMAIN }}/${{ secrets.REGISTRY_REPO }} --all-tags
29+ Deploy :
30+ needs : Build
31+ environment :
32+ name : Production
33+ runs-on : ubuntu-latest
34+ steps :
35+ - name : Login to Azure
36+ uses : azure/login@v2.0.0
37+ with :
38+ creds : ${{secrets.TDEI_CORE_AZURE_CREDS}}
39+ - name : Deploy to Production
40+ uses : azure/webapps-deploy@v2
41+ with :
42+ app-name : ${{ secrets.AZURE_WEBAPP_NAME }}
43+ images : ${{ secrets.REGISTRY_DOMAIN }}/${{ secrets.REGISTRY_REPO }}:${{ github.sha }}.
You can’t perform that action at this time.
0 commit comments