-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (89 loc) · 2.78 KB
/
master.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
name: Master
on:
push:
branches: ['master']
jobs:
test-ts:
if: ${{ ! endsWith(github.event.head_commit.message, '[skip ci]') }}
runs-on: ubuntu-latest
strategy:
matrix:
package:
- archive
- common-archive-client
- common-data
- common-postgres
- configurator
- gatherer-http
- gatherer-stdin
- publisher
steps:
- uses: actions/checkout@v4
- uses: arduino/setup-task@v2
with:
version: 3.38.0
- uses: oven-sh/setup-bun@v1
with:
bun-version: 1.1.20
- run: bun install --frozen-lockfile
- run: task ${{ matrix.package }}:lint
- run: task ${{ matrix.package }}:test
build-base-images:
if: ${{ ! endsWith(github.event.head_commit.message, '[skip ci]') }}
needs: test-ts
permissions:
contents: write
packages: write
strategy:
matrix:
args:
- context: .
image: ghcr.io/unkhz/ruuvipuserrin-base-bun
uses: ./.github/workflows/build-package.yml
with:
context: ${{ matrix.args.context }}
image: ${{ matrix.args.image }}
build-package-images:
if: ${{ ! endsWith(github.event.head_commit.message, '[skip ci]') }}
needs: build-base-images
permissions:
contents: write
packages: write
strategy:
matrix:
args:
- context: ./packages/archive
image: ghcr.io/unkhz/ruuvipuserrin-archive
- context: ./packages/configurator
image: ghcr.io/unkhz/ruuvipuserrin-configurator
uses: ./.github/workflows/build-package.yml
with:
context: ${{ matrix.args.context }}
image: ${{ matrix.args.image }}
update-version-tags:
if: ${{ ! endsWith(github.event.head_commit.message, '[skip ci]') }}
runs-on: ubuntu-latest
needs: build-package-images
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install yq
uses: mikefarah/yq@master
with:
cmd: yq --version
- name: Update version tags
run: |
function update_version_tag() {
file=$1
yq e '.images[0].newTag = "${{ github.sha }}"' -i $file
git add $file
}
update_version_tag ./packages/base-bun/.khz-k3s/kustomization.yaml
update_version_tag ./packages/archive/.khz-k3s/kustomization.yaml
update_version_tag ./packages/configurator/.khz-k3s/kustomization.yaml
git config --global user.email "juhani.pelli@gmail.com"
git config --global user.name "Juhani Pelli"
git commit -m "Deploy ${{ github.sha }} [skip ci]"
git push origin ${{ github.event.repository.default_branch }}