From 279f7f8a869ab6f1296e8745858035a95ed47be6 Mon Sep 17 00:00:00 2001 From: mwildt Date: Sun, 17 Mar 2024 19:38:52 +0100 Subject: [PATCH] Update main.yml --- .github/workflows/main.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dd11849..ba32aed 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,11 +27,11 @@ jobs: with: name: dependency-track-apiserver.sbom.json path: dependency-track-apiserver.sbom.json - - name: Login Registry - run: echo ${{ secrets.DOCKER_REPO_KEY }} | docker login -u github-build --password-stdin registry.ohrenpirat.de:5000 - - name: Docker Push - run: docker push registry.ohrenpirat.de:5000/mwildt/dependency-track-apiserver:latest - + - name: Push Image + if: ${{ github.ref == 'refs/heads/master' }} + run: | + echo ${{ secrets.DOCKER_REPO_KEY }} | docker login -u github-build --password-stdin registry.ohrenpirat.de:5000 + docker push registry.ohrenpirat.de:5000/mwildt/dependency-track-apiserver:latest build-frontend: runs-on: ubuntu-latest @@ -52,7 +52,8 @@ jobs: with: name: dependency-track-frontend.sbom.json path: dependency-track-frontend.sbom.json - - name: Login Registry - run: echo ${{ secrets.DOCKER_REPO_KEY }} | docker login -u github-build --password-stdin registry.ohrenpirat.de:5000 - - name: Docker Push - run: docker push registry.ohrenpirat.de:5000/mwildt/dependency-track-frontend:latest + - name: Push Image + if: ${{ github.ref == 'refs/heads/master' }} + run: | + echo ${{ secrets.DOCKER_REPO_KEY }} | docker login -u github-build --password-stdin registry.ohrenpirat.de:5000 + docker push registry.ohrenpirat.de:5000/mwildt/dependency-track-frontend:latest