Fixed Task 1564 and 1566 #25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| ######### Dev Workflow ######## | |
| on: | |
| pull_request: | |
| branches: [dev] | |
| types: | |
| - closed | |
| workflow_dispatch: | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| Build: | |
| environment: Development | |
| runs-on: ubuntu-latest | |
| if: github.event.pull_request.merged == true | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: azure/docker-login@v1 | |
| with: | |
| login-server: ${{ secrets.REGISTRY_DOMAIN }} | |
| username: ${{ secrets.REGISTRY_USERNAME }} | |
| password: ${{ secrets.REGISTRY_PASSWORD }} | |
| - name: Publish image to Azure Registry | |
| run: | | |
| 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' }} . | |
| docker push ${{ secrets.REGISTRY_DOMAIN }}/${{ secrets.REGISTRY_REPO }} --all-tags | |
| Deploy: | |
| needs: Build | |
| environment: | |
| name: Development | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Login to Azure | |
| uses: azure/login@v2.0.0 | |
| with: | |
| creds: ${{secrets.TDEI_CORE_AZURE_CREDS}} | |
| - name: Deploy to Dev | |
| uses: azure/webapps-deploy@v2 | |
| with: | |
| app-name: ${{ secrets.AZURE_WEBAPP_NAME }} | |
| images: ${{ secrets.REGISTRY_DOMAIN }}/${{ secrets.REGISTRY_REPO }}:${{ github.sha }} |