From aeaf78a3103f18d601a74b86383ab72592fafeca Mon Sep 17 00:00:00 2001 From: Tomofumi Hayashi Date: Tue, 21 Apr 2020 12:42:38 +0900 Subject: [PATCH] Skip docker push action if REPOSITORY_PASS is not set --- .github/workflows/docker-build-push-master.yml | 7 +++++-- .github/workflows/docker-build-push-release.yml | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-build-push-master.yml b/.github/workflows/docker-build-push-master.yml index ab1554a94..1e6357681 100644 --- a/.github/workflows/docker-build-push-master.yml +++ b/.github/workflows/docker-build-push-master.yml @@ -34,11 +34,13 @@ jobs: docker tag ${REPOSITORY}:latest-amd64 ${REPOSITORY}:snapshot-amd64 docker tag ${REPOSITORY}:latest-ppc64le ${REPOSITORY}:snapshot-ppc64le docker tag ${REPOSITORY}:latest-arm64v8 ${REPOSITORY}:snapshot-arm64v8 - + - name: Login to registry - run: docker login -u ${REPOSITORY_USER} -p ${{ secrets. REPOSITORY_PASS }} + if: github.repository == 'intel/multus-cni' + run: docker login -u ${REPOSITORY_USER} -p ${{ secrets.REPOSITORY_PASS }} - name: Push latest/snapshot images + if: github.repository == 'intel/multus-cni' run: | docker push ${REPOSITORY}:latest-amd64 docker push ${REPOSITORY}:latest-ppc64le @@ -48,6 +50,7 @@ jobs: docker push ${REPOSITORY}:snapshot-arm64v8 - name: Create manifest for multi-arch images + if: github.repository == 'intel/multus-cni' run: | docker manifest create ${REPOSITORY}:snapshot ${REPOSITORY}:snapshot-amd64 ${REPOSITORY}:snapshot-ppc64le ${REPOSITORY}:snapshot-arm64v8 docker manifest annotate ${REPOSITORY}:snapshot ${REPOSITORY}:snapshot-amd64 --arch amd64 diff --git a/.github/workflows/docker-build-push-release.yml b/.github/workflows/docker-build-push-release.yml index e0ff0544b..64c5972a0 100644 --- a/.github/workflows/docker-build-push-release.yml +++ b/.github/workflows/docker-build-push-release.yml @@ -39,9 +39,11 @@ jobs: docker tag ${REPOSITORY}:latest-arm64v8 ${REPOSITORY}:${GITHUB_REF##*/}-arm64v8 - name: Login to registry + if: github.repository == 'intel/multus-cni' run: docker login -u ${REPOSITORY_USER} -p ${{ secrets. REPOSITORY_PASS }} - name: Push latest/snapshot images + if: github.repository == 'intel/multus-cni' run: | docker push ${REPOSITORY}:latest-amd64 docker push ${REPOSITORY}:latest-ppc64le @@ -54,6 +56,7 @@ jobs: docker push ${REPOSITORY}:${GITHUB_REF##*/}-arm64v8 - name: Create manifest for multi-arch images + if: github.repository == 'intel/multus-cni' run: | docker manifest create ${REPOSITORY}:stable ${REPOSITORY}:stable-amd64 ${REPOSITORY}:stable-ppc64le ${REPOSITORY}:stable-arm64v8 docker manifest annotate ${REPOSITORY}:stable ${REPOSITORY}:stable-amd64 --arch amd64