Skip to content

Application Deployment #4

Application Deployment

Application Deployment #4

name: Application Deployment
on:
workflow_run:
workflows:
- "Application E2E Tests"
types:
- completed
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
push_to_registry:
name: Push to registry
if: ${{ !contains(github.ref, 'dependabot') }}
runs-on: ubuntu-22.04
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- name: Check status of required workflows
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
APLICATION_UNITS_TESTS_WORKFLOW_CONCLUSION=$(gh api repos/MTES-MCT/monitorfish/actions/runs --jq '.workflow_runs[] | select(.name=="Application Unit Tests").conclusion' | head -n 1)
APPLICATION_E2E_TESTS_WORKFLOW_CONCLUSION=$(gh api repos/MTES-MCT/monitorfish/actions/runs --jq '.workflow_runs[] | select(.name=="Application E2E Tests").conclusion' | head -n 1)
if [[ "$APLICATION_UNITS_TESTS_WORKFLOW_CONCLUSION" != "success" || "$APPLICATION_E2E_TESTS_WORKFLOW_CONCLUSION" != "success" ]]; then
exit 1
fi
- name: Checkout
uses: actions/checkout@v4
- name: Set version and environment profile
uses: ./.github/actions/set-version-and-environment-profile
- name: Download image
uses: ishworkh/[email protected]
with:
image: monitorfish-app:${{ env.VERSION }}
token: ${{ secrets.GITHUB_TOKEN }}
workflow: "Application Build"
- name: Push docker image to registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${GITHUB_ACTOR} --password-stdin
make docker-tag
make docker-push
- uses: LouisBrunner/[email protected]
if: ${{ always() }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Application Deployment
conclusion: ${{ job.status }}