From bc202bc4f46f57d5876330a31a17138f33728992 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Thu, 19 Sep 2024 11:54:18 +0200 Subject: [PATCH] ci: don't login to registry if not needed --- .github/workflows/ci.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7545e67..6b0beab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -111,12 +111,6 @@ jobs: - uses: actions/checkout@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Login to ghcr.io - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - name: Build image uses: docker/build-push-action@v6 with: @@ -139,6 +133,13 @@ jobs: PYTHONTAG: "${{ matrix.PYTHONTAG }}" DISTRO: "${{ matrix.DISTRO }}" run: pytest -v tests + - name: Login to ghcr.io + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + if: ${{ github.repository_owner == 'acsone' && github.ref == 'refs/heads/master' }} - name: Push image uses: docker/build-push-action@v6 with: