This repository has been archived by the owner on Nov 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
98 lines (88 loc) · 2.71 KB
/
ci.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: CI Pipeline
on:
pull_request:
branches:
- 'main'
- 'release/[0-9]+.[0-9]+'
push:
branches:
- 'main'
- 'release/[0-9]+.[0-9]+'
tags: [ 'v[0-9]+.[0-9]+.[0-9]+' ]
jobs:
code_quality_check:
uses: ./.github/workflows/code-quality-check.yml
secrets: inherit
setup_env:
uses: ./.github/workflows/setup-environment.yml
build_image:
needs:
- setup_env
- code_quality_check
uses: ./.github/workflows/image-build.yml
secrets: inherit
with:
component_version: ${{ needs.setup_env.outputs.component_version }}
publish_latest_from_dev_branch:
if: ${{ startsWith(github.ref, 'refs/heads/main') }}
uses: ./.github/workflows/image-publish.yml
needs:
- setup_env
- build_image
secrets: inherit
with:
gar_push_enabled: true
ecr_push_enabled: false
gar_image_name: us-docker.pkg.dev/vorvan/dev/h2oai-modelscoring-restscorer
image_tags: "${{ needs.setup_env.outputs.commit_hash }},latest"
publish_latest_from_release_branch:
if: startsWith(github.ref, 'refs/heads/release/')
uses: ./.github/workflows/image-publish.yml
needs:
- setup_env
- build_image
secrets: inherit
with:
gar_push_enabled: true
ecr_push_enabled: false
gar_image_name: us-docker.pkg.dev/vorvan/dev/h2oai-modelscoring-restscorer
image_tags: "${{ needs.setup_env.outputs.commit_hash }},latest-${{ needs.setup_env.outputs.release_base_version }}"
publish_release:
if: startsWith(github.ref, 'refs/tags/v')
uses: ./.github/workflows/image-publish.yml
needs:
- setup_env
- build_image
secrets: inherit
with:
gar_push_enabled: true
ecr_push_enabled: true
gar_image_name: us-docker.pkg.dev/vorvan/dev/h2oai-modelscoring-restscorer
ecr_image_name: 926522735405.dkr.ecr.us-east-1.amazonaws.com/h2oai-modelscoring-restscorer
image_tags: "v${{ needs.setup_env.outputs.release_version }}"
release:
needs:
- setup_env
- publish_release
name: Prepare Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate changelogs
id: changelog
uses: requarks/[email protected]
with:
token: ${{ github.token }}
tag: "v${{ needs.setup_env.outputs.release_version }}"
writeToFile: false
- name: Release action
uses: ncipollo/[email protected]
with:
allowUpdates: false
draft: false
tag: "v${{ needs.setup_env.outputs.release_version }}"
body: ${{ steps.changelog.outputs.changes }}
prerelease: false