Skip to content

Commit ed3ecfc

Browse files
authored
chore: build dogfood image on PRs and skip pushing to registry (coder#11311)
1 parent efe8c67 commit ed3ecfc

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

.github/workflows/dogfood.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@ on:
77
paths:
88
- "dogfood/**"
99
- ".github/workflows/dogfood.yaml"
10-
# Uncomment these lines when testing with CI.
11-
# pull_request:
12-
# paths:
13-
# - "dogfood/**"
14-
# - ".github/workflows/dogfood.yaml"
10+
pull_request:
11+
paths:
12+
- "dogfood/**"
13+
- ".github/workflows/dogfood.yaml"
1514
workflow_dispatch:
1615

1716
jobs:
@@ -37,6 +36,7 @@ jobs:
3736
uses: docker/setup-buildx-action@v3
3837

3938
- name: Login to DockerHub
39+
if: github.ref == 'refs/heads/main'
4040
uses: docker/login-action@v3
4141
with:
4242
username: ${{ secrets.DOCKERHUB_USERNAME }}
@@ -47,13 +47,14 @@ jobs:
4747
with:
4848
context: "{{defaultContext}}:dogfood"
4949
pull: true
50-
push: true
50+
push: ${{ github.ref == 'refs/heads/main' }}
5151
tags: "codercom/oss-dogfood:${{ steps.docker-tag-name.outputs.tag }},codercom/oss-dogfood:latest"
5252
cache-from: type=registry,ref=codercom/oss-dogfood:latest
5353
cache-to: type=inline
5454

5555
deploy_template:
5656
needs: deploy_image
57+
if: github.ref == 'refs/heads/main'
5758
runs-on: ubuntu-latest
5859
steps:
5960
- name: Checkout

0 commit comments

Comments
 (0)