From d148211769991795563a793ebf6c0c9f8c8e6620 Mon Sep 17 00:00:00 2001 From: Alexandre-P Date: Mon, 5 Sep 2022 11:29:12 +0200 Subject: [PATCH] ci: fix backend image build (#418) Signed-off-by: Alexandre-P --- .../{gcr.yml => container-image-backend.yml} | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) rename .github/workflows/{gcr.yml => container-image-backend.yml} (81%) diff --git a/.github/workflows/gcr.yml b/.github/workflows/container-image-backend.yml similarity index 81% rename from .github/workflows/gcr.yml rename to .github/workflows/container-image-backend.yml index 1a244a7d4..adf8d58d0 100644 --- a/.github/workflows/gcr.yml +++ b/.github/workflows/container-image-backend.yml @@ -12,6 +12,7 @@ on: paths: - 'docker/substra-backend/*' - 'backend/**' + - '.github/workflows/container-image-backend.yml' jobs: build: @@ -31,18 +32,20 @@ jobs: echo "BACKEND_VERSION=`echo $GITHUB_REF | cut -d / -f 3`+`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV fi - - name: Login to GCR + - name: Login to registry uses: docker/login-action@v2 + if: ${{ github.event_name != 'pull_request' }} with: - registry: gcr.io - username: _json_key - password: ${{ secrets.GCP_SA_KEY }} + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Docker metadata id: docker-metadata uses: docker/metadata-action@v4 with: - images: 'gcr.io/${{ secrets.GCP_PROJECT_ID }}/connect-backend' + images: 'ghcr.io/substra/substra-backend' flavor: | latest=${{ env.LATEST }}