From c902e98efc7f6a64bb05e52f021b04a76bbff932 Mon Sep 17 00:00:00 2001 From: Alexandr Demicev Date: Mon, 7 Oct 2024 16:31:29 +0200 Subject: [PATCH] Add prime image builds Signed-off-by: Alexandr Demicev --- .github/workflows/release.yml | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cd8adf4c..54819438 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,7 @@ on: env: TAG: ${{ github.ref_name }} - REGISTRY: ghcr.io + GHCR_REGISTRY: ghcr.io jobs: build: @@ -24,16 +24,32 @@ jobs: uses: actions/setup-go@v5 with: go-version: '=1.21.8' - - name: Docker login + - name: Docker login ghcr.io uses: docker/login-action@v3 with: - registry: ${{ env.REGISTRY }} + registry: ${{ env.GHCR_REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Build docker image + - name: Build docker image for ghcr.io run: make docker-build-all TAG=${{ env.TAG }} - - name: Push docker image - run: make docker-push-all TAG=${{ env.TAG }} PROD_REGISTRY=${{ env.REGISTRY }} + - name: Push docker image to ghcr.io + run: make docker-push-all TAG=${{ env.TAG }} PROD_REGISTRY=${{ env.GHCR_REGISTRY }} + - name: Read prime registry secrets + uses: rancher-eio/read-vault-secrets@main + with: + secrets: | + secret/data/github/repo/${{ inputs.github_repository_for_docker }}/registry/prime/rancher/cluster-api-controller/credentials username | DOCKER_USERNAME; + secret/data/github/repo/${{ inputs.github_repository_for_docker }}/registry/prime/rancher/cluster-api-controller/credentials password | DOCKER_PASSWORD; + - name: Docker login to registry + uses: docker/login-action@v3 + with: + registry: ${{ vars.PRIME_REGISTRY }} + username: ${{ env.DOCKER_USERNAME }} + password: ${{ env.DOCKER_PASSWORD }} + - name: Build docker image for prime registry + run: make docker-build-all TAG=${{ env.TAG }} + - name: Push docker image to prime registry + run: make docker-push-all TAG=${{ env.TAG }} PROD_REGISTRY=${{ vars.PRIME_REGISTRY }} release: runs-on: ubuntu-latest permissions: