Add error alerts #7
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
| name: Deploy | |
| on: | |
| push | |
| jobs: | |
| my-job: | |
| runs-on: ubuntu-latest | |
| env: | |
| # REPLACE THIS | |
| DOCKERHUB_USERNAME: aleyipsoftwire | |
| # SET THESE IN GITHUB | |
| DOCKERHUB_TOKEN: '${{ secrets.DOCKERHUB_TOKEN }}' | |
| AZURE_WEBHOOK: '${{ secrets.AZURE_WEBHOOK }}' | |
| # DECIDE WHETHER YOU WANT A BRANCH CHECK - if so remove the other "if" | |
| # if: github.ref == 'refs/heads/master' | |
| if: github.repository != 'corndeladmin/DevOps-Course-Workshop-Module-13-Learners' | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v3 | |
| - name: Build image | |
| run: docker build --tag ${DOCKERHUB_USERNAME}/m13-order-processing-app --target production . | |
| - name: Docker login | |
| run: echo $DOCKERHUB_TOKEN | docker login -u $DOCKERHUB_USERNAME --password-stdin | |
| - name: Push image | |
| run: docker push ${DOCKERHUB_USERNAME}/m13-order-processing-app | |
| - name: Trigger deployment | |
| run: curl --fail-with-body -X POST "$AZURE_WEBHOOK" |