From ed3ecfc9239f43f77cb8e20f82b929a7f99d1a72 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Sun, 24 Dec 2023 11:43:38 +0300 Subject: [PATCH] chore: build dogfood image on PRs and skip pushing to registry (#11311) --- .github/workflows/dogfood.yaml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/dogfood.yaml b/.github/workflows/dogfood.yaml index c3d9020f31..623c145db6 100644 --- a/.github/workflows/dogfood.yaml +++ b/.github/workflows/dogfood.yaml @@ -7,11 +7,10 @@ on: paths: - "dogfood/**" - ".github/workflows/dogfood.yaml" - # Uncomment these lines when testing with CI. - # pull_request: - # paths: - # - "dogfood/**" - # - ".github/workflows/dogfood.yaml" + pull_request: + paths: + - "dogfood/**" + - ".github/workflows/dogfood.yaml" workflow_dispatch: jobs: @@ -37,6 +36,7 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Login to DockerHub + if: github.ref == 'refs/heads/main' uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} @@ -47,13 +47,14 @@ jobs: with: context: "{{defaultContext}}:dogfood" pull: true - push: true + push: ${{ github.ref == 'refs/heads/main' }} tags: "codercom/oss-dogfood:${{ steps.docker-tag-name.outputs.tag }},codercom/oss-dogfood:latest" cache-from: type=registry,ref=codercom/oss-dogfood:latest cache-to: type=inline deploy_template: needs: deploy_image + if: github.ref == 'refs/heads/main' runs-on: ubuntu-latest steps: - name: Checkout