-
Notifications
You must be signed in to change notification settings - Fork 3
208 lines (180 loc) · 6.18 KB
/
publish.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
name: Wheel + Docker publish
on:
push:
branches:
- next
- qa
- main
env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
- name: Setup libmamba solver
run: |
conda install -n base conda-libmamba-solver
conda config --set solver libmamba
- name: Install requirements
run: |
# --quiet should turn off progress bars to make logs more readable
conda env create --file conda_environment.yml --quiet
conda activate webmon
conda env update --file conda_development.yml --quiet
- name: Build wheels
run: |
conda activate webmon
make wheel/all
- name: Create tag version
id: tag
run: |
conda activate webmon
echo "tag=$(versioningit src/webmon_app)" >> $GITHUB_OUTPUT
- name: Create latest tag version
id: latest_tag
run: |
case ${{ github.ref }} in
refs/heads/next)
echo "latest_tag=latest-dev" >> $GITHUB_OUTPUT
;;
refs/heads/qa)
echo "latest_tag=latest-test" >> $GITHUB_OUTPUT
;;
refs/heads/main)
echo "latest_tag=latest-prod" >> $GITHUB_OUTPUT
;;
*)
exit 1
;;
esac
- name: Upload wheels
uses: softprops/action-gh-release@v2
if: ${{ github.ref == 'refs/heads/main' }}
with:
tag_name: ${{ steps.tag.outputs.tag }}
files: src/*/dist/*.whl
- name: Check tag names
run: |
echo ${{ steps.latest_tag.outputs.latest_tag }}
echo ${{ steps.tag.outputs.tag }}
- name: Build test data for autoreducer
run: make SNSdata.tar.gz
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push amq_test_gen
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile.amq_test_gen
tags: |
${{ env.REGISTRY }}/${{ github.repository }}/amq_test_gen:${{ steps.latest_tag.outputs.latest_tag }}
push: true
- name: Push amq_test_gen with version tag only for main branch
if: github.ref == 'refs/heads/main'
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile.amq_test_gen
tags: |
${{ env.REGISTRY }}/${{ github.repository }}/amq_test_gen:${{ steps.tag.outputs.tag }}
push: true
- name: Build and push Autoreducer
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile.autoreducer
tags: |
${{ env.REGISTRY }}/${{ github.repository }}/autoreducer:${{ steps.latest_tag.outputs.latest_tag }}
push: true
- name: Push Autoreducer with version tag only for main branch
if: github.ref == 'refs/heads/main'
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile.autoreducer
tags: |
${{ env.REGISTRY }}/${{ github.repository }}/autoreducer:${{ steps.tag.outputs.tag }}
push: true
- name: Build and push Dasmon
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile.dasmon
tags: |
${{ env.REGISTRY }}/${{ github.repository }}/dasmon:${{ steps.latest_tag.outputs.latest_tag }}
push: true
- name: Push Dasmon with version tag only for main branch
if: github.ref == 'refs/heads/main'
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile.dasmon
tags: |
${{ env.REGISTRY }}/${{ github.repository }}/dasmon:${{ steps.tag.outputs.tag }}
push: true
- name: Build and push pv_test_gen
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile.pv_test_gen
tags: |
${{ env.REGISTRY }}/${{ github.repository }}/pv_test_gen:${{ steps.latest_tag.outputs.latest_tag }}
push: true
- name: Push pv_test_gen with version tag only for main branch
if: github.ref == 'refs/heads/main'
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile.pv_test_gen
tags: |
${{ env.REGISTRY }}/${{ github.repository }}/pv_test_gen:${{ steps.tag.outputs.tag }}
push: true
- name: Build and push Webmon
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile.webmon
tags: |
${{ env.REGISTRY }}/${{ github.repository }}/webmon:${{ steps.latest_tag.outputs.latest_tag }}
push: true
- name: Push Webmon with version tag only for main branch
if: github.ref == 'refs/heads/main'
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile.webmon
tags: |
${{ env.REGISTRY }}/${{ github.repository }}/webmon:${{ steps.tag.outputs.tag }}
push: true
- name: Build and push Workflow
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile.workflow
tags: |
${{ env.REGISTRY }}/${{ github.repository }}/workflow:${{ steps.latest_tag.outputs.latest_tag }}
push: true
- name: Push Workflow with version tag only for main branch
if: github.ref == 'refs/heads/main'
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile.workflow
tags: |
${{ env.REGISTRY }}/${{ github.repository }}/workflow:${{ steps.tag.outputs.tag }}
push: true