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 }}