Skip to content

Commit d97e6ea

Browse files
committed
copies current images through actions
1 parent 3be03d0 commit d97e6ea

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

.github/workflows/images.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: images
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
publish:
10+
name: Publish
11+
runs-on: ubuntu-latest
12+
permissions:
13+
packages: write
14+
steps:
15+
-
16+
name: Checkout
17+
uses: actions/checkout@v4
18+
-
19+
name: Login to GitHub Container Registry
20+
uses: docker/login-action@v3
21+
with:
22+
registry: ghcr.io
23+
username: ${{ github.repository_owner }}
24+
password: ${{ secrets.GITHUB_TOKEN }}
25+
-
26+
uses: actions/setup-go@v5
27+
with:
28+
go-version: 1.22
29+
-
30+
uses: imjasonh/[email protected]
31+
-
32+
name: Get mariadb docker hub image
33+
id: imageMariadbFrom
34+
uses: mikefarah/[email protected]
35+
with:
36+
cmd: yq '.images[0].name + ":" + .images[0].newTag' 'base/kustomization.yaml'
37+
-
38+
name: Get mariadb target image
39+
id: imageMariadbTo
40+
uses: mikefarah/[email protected]
41+
with:
42+
cmd: yq '.images[0].newName + ":" + .images[0].newTag' 'base/kustomization.yaml'
43+
-
44+
name: Get exporter docker hub image
45+
id: imageExporterFrom
46+
uses: mikefarah/[email protected]
47+
with:
48+
cmd: yq '.images[1].name + ":" + .images[1].newTag' 'base/kustomization.yaml'
49+
-
50+
name: Get exporter target image
51+
id: imageExporterTo
52+
uses: mikefarah/[email protected]
53+
with:
54+
cmd: yq '.images[1].newName + ":" + .images[1].newTag' 'base/kustomization.yaml'
55+
-
56+
run: |
57+
crane cp ${{ steps.imageMariadbFrom.outputs.result }} ${{ steps.imageMariadbTo.outputs.result }}
58+
crane cp ${{ steps.imageExporterFrom.outputs.result }} ${{ steps.imageExporterTo.outputs.result }}

base/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ images:
1313
newName: ghcr.io/yolean/mariadb
1414
newTag: 10.11.8-jammy@sha256:b4fef57eee430a8f78da9850264dfeebdbbac197122be85d746041aee35b2f2d
1515
- name: prom/mysqld-exporter
16+
newName: ghcr.io/yolean/mysqld-exporter
1617
newTag: v0.14.0@sha256:eb6fe170738bf9181c51f5bc89f93adb26672ec49ffdcb22f55c24834003b45d

0 commit comments

Comments
 (0)