From cc3712993bafa81035b418f3d48d38cf21c8f72d Mon Sep 17 00:00:00 2001 From: Cristovao Cordeiro Date: Tue, 15 Aug 2023 15:15:30 +0200 Subject: [PATCH] ci: add Artifactory registry credentials to workflows --- .github/workflows/build.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 036c96b8e626..375b49c17e22 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -378,10 +378,14 @@ jobs: name: Login to GHCR if: needs.release-base.outputs.push == 'push' uses: docker/login-action@v2 + env: + REGISTRY: ${{ startsWith(github.ref, 'refs/tags/v') && secrets.ARTIFACTORY_REGISTRY || 'ghcr.io' }} + USERNAME: ${{ startsWith(github.ref, 'refs/tags/v') && secrets.ARTIFACTORY_USER || github.actor }} + PASSWORD: ${{ startsWith(github.ref, 'refs/tags/v') && secrets.ARTIFACTORY_ACCESS_TOKEN || secrets.GITHUB_TOKEN }} with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + registry: ${{ env.REGISTRY }} + username: ${{ env.USERNAME }} + password: ${{ env.PASSWORD }} - name: Build local image for testing run: |