From f9d0ad8eb633682fc77554a36d243c498fcd9145 Mon Sep 17 00:00:00 2001 From: vincentsarago Date: Mon, 20 Nov 2023 16:01:09 +0100 Subject: [PATCH] login only if deploy [skip ci] --- .github/workflows/ci.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 52565af..79f52cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,13 +44,6 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: us-east-1 - - name: Build uses: docker/build-push-action@v3 with: @@ -71,6 +64,15 @@ jobs: --rm ghcr.io/${{ github.repository_owner }}/lambda-gdal:${{ matrix.gdal-version }} \ /local/tests/tests.sh + # Publish + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v1 + if: github.ref == 'refs/heads/master' + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-east-1 + - name: Publish docker image uses: docker/build-push-action@v3 if: github.ref == 'refs/heads/master'