From ee7a5dfc2c1e798c10d12f2538118d6d026dd79f Mon Sep 17 00:00:00 2001 From: shreyasbhat0 Date: Tue, 16 Jul 2024 11:00:41 +0530 Subject: [PATCH] chore: add docker build --- .github/workflows/copybara-docker.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/copybara-docker.yml b/.github/workflows/copybara-docker.yml index 23a0eea..d6de455 100644 --- a/.github/workflows/copybara-docker.yml +++ b/.github/workflows/copybara-docker.yml @@ -6,7 +6,6 @@ on: jobs: publish-copybara: - if: github.repository == 'Olivr/copybara-action' runs-on: ubuntu-latest permissions: contents: read @@ -14,21 +13,23 @@ jobs: id-token: write name: Publish to Docker Hub steps: - - uses: actions/checkout@v2 + - name: Checkout Copybara source repository + uses: actions/checkout@v2 with: repository: google/copybara + path: copybara fetch-depth: 1 - name: Get Copybara latest commit's SHA - run: echo "COPYBARA_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV + run: echo "COPYBARA_SHA=$(git -C copybara rev-parse --short HEAD)" >> $GITHUB_ENV - name: Extract metadata from GitHub Action context id: meta uses: docker/metadata-action@v3 with: images: | - olivr/copybara - ghcr.io/olivr/copybara + shreyasbhat0/copybara + ghcr.io/shreyasbhat0/copybara tags: | type=raw,${{ env.COPYBARA_SHA }} type=schedule,pattern={{date 'YYYYMMDD'}} @@ -45,8 +46,8 @@ jobs: - name: Login to DockerHub uses: docker/login-action@v1 with: - username: olivrbot - password: ${{ secrets.DOCKER_TOKEN_BOT }} + username: yourdockerhubusername + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Login to GitHub Container Registry uses: docker/login-action@v1 @@ -55,9 +56,8 @@ jobs: username: ${{ github.actor }} password: ${{ github.token }} - # Remove when https://github.com/google/copybara/pull/186 is merged - name: Use working Dockerfile - run: curl -s https://raw.githubusercontent.com/Olivr/copybara-action/main/.github/Dockerfile > Dockerfile + run: curl -s https://raw.githubusercontent.com/google/copybara/main/.github/Dockerfile > Dockerfile - name: Build and push uses: docker/build-push-action@v2 @@ -71,6 +71,7 @@ jobs: # Experimental - name: Install Cosign uses: sigstore/cosign-installer@main + - name: Sign the image with GitHub OIDC **EXPERIMENTAL** run: cosign sign --oidc-issuer https://token.actions.githubusercontent.com ${TAGS} env: