diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index eca7125..4aae38f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -53,7 +53,7 @@ jobs: tags: ${{ env.REGISTRY }}/credentials-operator:${{ github.sha }} push: true network: host - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64 cache-from: type=gha cache-to: type=gha,mode=max @@ -80,4 +80,4 @@ jobs: - name: Tag Images as latest run: |- retag_image_as_latest() { if [[ $(gcloud container images add-tag "${{ env.REGISTRY }}/$1:${{ github.sha }}" "${{ env.REGISTRY }}/$1:latest" --quiet) ]]; then echo "Failed tagging $1 as latest"; exit 1; fi } # using --quiet to avoid prompt - retag_image_as_latest credentials-operator \ No newline at end of file + retag_image_as_latest credentials-operator diff --git a/.github/workflows/release-tag.yaml b/.github/workflows/release-tag.yaml index 5360f31..192cb73 100644 --- a/.github/workflows/release-tag.yaml +++ b/.github/workflows/release-tag.yaml @@ -32,13 +32,26 @@ jobs: username: otterize password: ${{ secrets.DOCKER_PASSWORD }} + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + with: + driver-opts: network=host + + - name: Push to Docker Hub - run: |- - docker pull ${{ env.REGISTRY }}/credentials-operator:${{ github.sha }} - docker tag ${{ env.REGISTRY }}/credentials-operator:${{ github.sha }} otterize/credentials-operator:${{ github.ref_name }} - docker tag ${{ env.REGISTRY }}/credentials-operator:${{ github.sha }} otterize/credentials-operator:latest - docker push otterize/credentials-operator:${{ github.ref_name }} - docker push otterize/credentials-operator:latest + uses: docker/build-push-action@v2 + with: + context: .github/workflows + file: .github/workflows/release.Dockerfile + tags: otterize/credentials-operator:latest,otterize/credentials-operator:${{ github.ref_name }} + push: true + network: host + platforms: linux/amd64,linux/arm64 + build-args: | + "VERSION=${{ github.ref_name }}" + "SOURCE_IMAGE=${{ env.REGISTRY }}/credentials-operator:${{ github.sha }}" + commit-latest-build-tag-to-helm-chart: name: Commit Latest Build Tag diff --git a/.github/workflows/release.Dockerfile b/.github/workflows/release.Dockerfile new file mode 100644 index 0000000..7f5bb3e --- /dev/null +++ b/.github/workflows/release.Dockerfile @@ -0,0 +1,10 @@ +# The only purpose this Dockerfile serves is to be able to run buildx to push a multi-platform image without rebuilding. + +ARG SOURCE_IMAGE + +FROM alpine as releaser +ARG VERSION +RUN echo -n $VERSION > ./version + +FROM $SOURCE_IMAGE +COPY --from=releaser /version . \ No newline at end of file