8
8
branches :
9
9
- " main"
10
10
11
+ workflow_dispatch :
12
+
13
+ env :
14
+ REGISTRY : ghcr.io
15
+
11
16
jobs :
12
17
commitlint :
13
- runs-on : ubuntu-22 .04
18
+ runs-on : ubuntu-24 .04
14
19
steps :
15
20
- name : Checkout
16
21
uses : actions/checkout@v4
@@ -19,34 +24,68 @@ jobs:
19
24
- name : commitlint
20
25
uses : wagoid/commitlint-github-action@v5
21
26
test :
22
- runs-on : ubuntu-22 .04
27
+ runs-on : ubuntu-24 .04
23
28
env :
24
29
USER_ID : 1001
25
30
GROUP_ID : 1001
26
31
steps :
27
32
- name : Checkout
28
33
uses : actions/checkout@v4
29
34
- name : Compose Build
30
- run : docker- compose build --progress=plain
35
+ run : docker compose build --progress=plain
31
36
- name : Compose Up
32
- run : docker- compose up -d
37
+ run : docker compose up -d
33
38
- name : Test
34
39
run : docker compose exec app poetry run pytest
35
40
release :
36
- runs-on : ubuntu-22.04
37
- needs : [test, commitlint]
41
+ runs-on : ubuntu-24.04
38
42
if : github.event_name == 'push'
43
+ needs : [test, commitlint]
44
+ outputs :
45
+ git-tag : ${{ steps.semantic.outputs.git-tag }}
39
46
steps :
40
47
- name : Checkout
41
48
uses : actions/checkout@v4
42
49
- name : Setup Node.js
43
50
uses : actions/setup-node@v4
44
- with :
45
- node-version : 20
46
51
- name : Install semantic-release
47
-
48
- - name : Release
52
+
53
+ - name : Run semantic-release
54
+ id : semantic
49
55
env :
50
- GITHUB_USERNAME : ${{ secrets.GH_USERNAME }}
51
- GITHUB_TOKEN : ${{ secrets.GH_TOKEN }}
56
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
52
57
run : npx semantic-release
58
+ ghcr :
59
+ runs-on : ubuntu-24.04
60
+ if : |
61
+ github.repository_owner == 'Virtool' &&
62
+ (github.event_name == 'push' || github.event_name == 'workflow_dispatch') &&
63
+ needs.release.outputs.git-tag != ''
64
+ needs : [release]
65
+ steps :
66
+ - name : Checkout
67
+ uses : actions/checkout@v4
68
+ with :
69
+ ref : ${{ needs.release.outputs.git-tag }}
70
+ - name : Write VERSION file
71
+ run : echo ${{ needs.release.outputs.git-tag }} > VERSION
72
+ - name : Login to Registry
73
+ uses : docker/login-action@v3
74
+ with :
75
+ registry : ${{ env.REGISTRY }}
76
+ username : ${{ github.actor }}
77
+ password : ${{ secrets.GITHUB_TOKEN }}
78
+ - name : Extract Metadata
79
+ id : meta
80
+ uses : docker/metadata-action@v5
81
+ with :
82
+ context : git
83
+ images : ${{ env.REGISTRY }}/virtool/nuvs
84
+ - name : Build and Push
85
+ uses : docker/build-push-action@v4
86
+ with :
87
+ context : .
88
+ labels : ${{ steps.meta.outputs.labels }}
89
+ push : true
90
+ tags : ${{ steps.meta.outputs.tags }}
91
+ target : base
0 commit comments