copies current images through actions #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: imageExporterFrom | |
uses: mikefarah/[email protected] | |
with: | |
cmd: yq '.images[1].name + ":" + .images[1].newTag' 'base/kustomization.yaml' | |
- | |
name: Get exporter target image | |
id: imageExporterTo | |
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 }} |