Skip to content

Commit

Permalink
copies current images through actions
Browse files Browse the repository at this point in the history
  • Loading branch information
solsson committed May 29, 2024
1 parent 3be03d0 commit b0e78a9
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/images.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: images

on:
push:
branches:
- main

jobs:
publish:
name: Publish
runs-on: ubuntu-latest
permissions:
packages: write
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
uses: actions/setup-go@v5
with:
go-version: 1.22
-
uses: imjasonh/[email protected]
-
name: Get mariadb docker hub image
id: imageMariadbFrom
uses: mikefarah/[email protected]
with:
cmd: yq '.images[0].name + ":" + .images[0].newTag' 'base/kustomization.yaml'
-
name: Get mariadb target image
id: imageMariadbTo
uses: mikefarah/[email protected]
with:
cmd: yq '.images[0].newName + ":" + .images[0].newTag' 'base/kustomization.yaml'
-
name: Get exporter docker hub image
id: imageMariadbFrom
uses: mikefarah/[email protected]
with:
cmd: yq '.images[1].name + ":" + .images[1].newTag' 'base/kustomization.yaml'
-
name: Get exporter target image
id: imageMariadbTo
uses: mikefarah/[email protected]
with:
cmd: yq '.images[1].newName + ":" + .images[1].newTag' 'base/kustomization.yaml'
-
run: |
crane cp ${{ steps.imageMariadbFrom.outputs.result }} ${{ steps.imageMariadbTo.outputs.result }}
crane cp ${{ steps.imageExporterFrom.outputs.result }} ${{ steps.imageExporterTo.outputs.result }}
1 change: 1 addition & 0 deletions base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ images:
newName: ghcr.io/yolean/mariadb
newTag: 10.11.8-jammy@sha256:b4fef57eee430a8f78da9850264dfeebdbbac197122be85d746041aee35b2f2d
- name: prom/mysqld-exporter
newName: ghcr.io/yolean/mysqld-exporter
newTag: v0.14.0@sha256:eb6fe170738bf9181c51f5bc89f93adb26672ec49ffdcb22f55c24834003b45d

0 comments on commit b0e78a9

Please sign in to comment.