-
Notifications
You must be signed in to change notification settings - Fork 7
78 lines (69 loc) · 2.86 KB
/
application_deployment.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
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: Initialize job status check
id: initialize_job_status_check
uses: LouisBrunner/checks-action@v2.0.0
with:
details_url: "https://github.com/MTES-MCT/monitorfish/actions/runs/${{ github.run_id }}/job/${{ github.job_id }}"
name: Application Deployment
sha: ${{ github.event.push.head_commit.id }}
status: in_progress
token: ${{ secrets.GITHUB_TOKEN }}
- name: Check Unit Tests status
id: check_unit_tests_status
uses: LASER-Yi/workflow-status@v0.1.0
with:
branch: ${{ github.event.workflow_run.head_branch }}
token: ${{ secrets.GITHUB_TOKEN }}
workflow: application_unit_tests.yml
- name: Checkout
if: ${{ steps.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_unit_tests_status.outputs.conclusion == 'success' }}
uses: ./.github/actions/set-version-and-environment-profile
- name: Download image
if: ${{ steps.check_unit_tests_status.outputs.conclusion == 'success' }}
uses: ishworkh/container-image-artifact-download@v2.0.0
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_unit_tests_status.outputs.conclusion == 'success' }}
continue-on-error: true
id: push_docker_image
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${GITHUB_ACTOR} --password-stdin
make docker-tag
make docker-push
- uses: LouisBrunner/checks-action@v2.0.0
if: ${{ always() }}
with:
check_id: ${{ steps.initialize_job_status_check.outputs.check_id }}
conclusion: ${{ steps.push_docker_image.outcome }}
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 }}
status: completed
token: ${{ secrets.GITHUB_TOKEN }}