Skip to content

Application Deployment #16

Application Deployment

Application Deployment #16

name: Application Deployment
on:
workflow_run:
workflows:
- "Application E2E Tests"
types:
- completed
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.event.workflow_run.head_branch }}
cancel-in-progress: true
jobs:
push_to_registry:
name: Push to registry
if: ${{ github.event.workflow_run.conclusion == 'success' && !contains(github.ref, 'dependabot') }}
runs-on: ubuntu-22.04
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- name: Check Unit Tests status
id: check_unit_tests_status
uses: LASER-Yi/[email protected]
with:
branch: ${{ github.event.workflow_run.head_branch }}
token: ${{ secrets.GITHUB_TOKEN }}
workflow: application_unit_tests.yml
- name: Checkout
if: ${{ steps.check-check_unit_tests_status.outputs.conclusion == 'success' }}
uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_commit.id }}
- name: Set version and environment profile
if: ${{ steps.check-check_unit_tests_status.outputs.conclusion == 'success' }}
uses: ./.github/actions/set-version-and-environment-profile
- name: Download image
if: ${{ steps.check-check_unit_tests_status.outputs.conclusion == 'success' }}
uses: ishworkh/[email protected]
with:
commit_sha: ${{ github.event.workflow_run.head_commit.id }}
image: monitorfish-app:${{ env.VERSION }}
token: ${{ secrets.GITHUB_TOKEN }}
workflow: "Application Build"
- name: Push docker image to registry
if: ${{ steps.check-check_unit_tests_status.outputs.conclusion == 'success' }}
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:
check_id: application-deployment-${{ github.event.workflow_run.head_commit.id }}
conclusion: ${{ job.status }}
details_url: "https://github.com/MTES-MCT/monitorfish/actions/runs/${{ github.run_id }}/job/${{ github.job_id }}"
sha: ${{ github.event.workflow_run.head_commit.id }}
token: ${{ secrets.GITHUB_TOKEN }}