fix: image name for custom naming scheme #4
This file contains hidden or 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: Create and publish toolkit base image | ||
| on: | ||
| workflow_dispatch: | ||
| env: | ||
| REGISTRY: ghcr.io | ||
| IMAGE_SUFFIX: eks-toolkit-base | ||
| IMAGE_OWNER: ${{ github.repository_owner }} | ||
| IMAGE_NAME: ${{ env.IMAGE_OWNER }}/${{ env.IMAGE_SUFFIX }} | ||
| BUILD_CONTEXT: tests/images/toolkit-base/ | ||
| jobs: | ||
| build-and-push-image: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| attestations: write | ||
| id-token: write | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v5 | ||
| - name: Install jq | ||
| run: sudo apt-get update && sudo apt-get install -y jq | ||
| - name: Setup QEMU | ||
| uses: docker/setup-qemu-action@v3 | ||
| - name: Setup docker buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
| - name: Log in to the Container registry | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ${{ env.REGISTRY }} | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Extract metadata (tags, labels) for Docker | ||
| id: meta | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
| tags: | | ||
| type=sha,prefix=,suffix=,enable=true,event=push,length=7 | ||
| type=raw,value=latest,enable=true | ||
| - name: Extract latest tool versions | ||
| id: versions | ||
| working-directory: ${{ env.BUILD_CONTEXT }} | ||
| run: | | ||
| chmod +x ./get_versions.sh | ||
| ./get_versions.sh | ||
| - name: Build and push Docker image | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: ${{ env.BUILD_CONTEXT }} | ||
| platforms: linux/amd64,linux/arm64 | ||
| push: true | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
| build-args: | | ||
| KUBECTL_VERSION=${{ steps.versions.outputs.k8s_tag }} | ||
| HELM_VERSION=${{ steps.versions.outputs.helm_version }} | ||
| KUSTOMIZE_VERSION=${{ steps.versions.outputs.kustomize_version }} | ||
| KUBESEAL_VERSION=${{ steps.versions.outputs.kubeseal_version }} | ||
| KREW_VERSION=${{ steps.versions.outputs.krew_version }} | ||
| VALS_VERSION=${{ steps.versions.outputs.vals_version }} | ||
| KUBECONFORM_VERSION=${{ steps.versions.outputs.kubeconform_version }} | ||