From 92301fe3b0714e9bda93a241c6d8940d292e5ebc Mon Sep 17 00:00:00 2001 From: etvt <149910696+etvt@users.noreply.github.com> Date: Fri, 24 Nov 2023 19:29:06 +0100 Subject: [PATCH] Fix WF. --- .github/workflows/docker-image.yml | 103 +++++++++++++++-------------- 1 file changed, 53 insertions(+), 50 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 7832bfb..7629cee 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -2,7 +2,7 @@ name: Build and Push Docker image on: push: - branches: [ "master" ] + branches: [ "fix_wf" ] pull_request: branches: [ "master" ] @@ -16,53 +16,56 @@ jobs: id-token: 'write' steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to GitHub Container Registry - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and push Docker image - uses: docker/build-push-action@v5.1.0 - with: - context: . - file: Dockerfile - push: ${{ github.event_name != 'pull_request' }} - tags: ghcr.io/etvt/aitestdrive:latest - cache-from: type=gha - cache-to: type=gha,mode=max - - - name: Login to Google Cloud - id: 'google-cloud-auth' - if: github.event_name != 'pull_request' - uses: 'google-github-actions/auth@v1' - with: - workload_identity_provider: '${{ secrets.WIF_PROVIDER }}' - service_account: '${{ secrets.WIF_SERVICE_ACCOUNT }}' - - - name: Set up Cloud SDK - uses: 'google-github-actions/setup-gcloud@v1' - with: - project_id: '${{ env.PROJECT_ID }}' - - - name: Docker auth - run: |- - gcloud auth configure-docker gcr.io + - name: Echo Project ID + run: echo "Project ID is $PROJECT_ID" - - name: Build and push Docker image to GCR - uses: docker/build-push-action@v5.1.0 - with: - context: . - file: Dockerfile - push: ${{ github.event_name != 'pull_request' }} - tags: gcr.io/${{ env.PROJECT_ID }}/aitestdrive:latest - cache-from: type=gha - cache-to: type=gha,mode=max +# - name: Checkout repository +# uses: actions/checkout@v3 +# +# - name: Set up Docker Buildx +# uses: docker/setup-buildx-action@v3 +# +# - name: Login to GitHub Container Registry +# if: github.event_name != 'pull_request' +# uses: docker/login-action@v3 +# with: +# registry: ghcr.io +# username: ${{ github.actor }} +# password: ${{ secrets.GITHUB_TOKEN }} +# +# - name: Build and push Docker image +# uses: docker/build-push-action@v5.1.0 +# with: +# context: . +# file: Dockerfile +# push: ${{ github.event_name != 'pull_request' }} +# tags: ghcr.io/etvt/aitestdrive:latest +# cache-from: type=gha +# cache-to: type=gha,mode=max +# +# - name: Login to Google Cloud +# id: 'google-cloud-auth' +# if: github.event_name != 'pull_request' +# uses: 'google-github-actions/auth@v1' +# with: +# workload_identity_provider: '${{ secrets.WIF_PROVIDER }}' +# service_account: '${{ secrets.WIF_SERVICE_ACCOUNT }}' +# +# - name: Set up Cloud SDK +# uses: 'google-github-actions/setup-gcloud@v1' +# with: +# project_id: '${{ env.PROJECT_ID }}' +# +# - name: Docker auth +# run: |- +# gcloud auth configure-docker gcr.io +# +# - name: Build and push Docker image to GCR +# uses: docker/build-push-action@v5.1.0 +# with: +# context: . +# file: Dockerfile +# push: ${{ github.event_name != 'pull_request' }} +# tags: gcr.io/${{ env.PROJECT_ID }}/aitestdrive:latest +# cache-from: type=gha +# cache-to: type=gha,mode=max