chore: build dogfood image on PRs and skip pushing to registry (#11311)

This commit is contained in:
Muhammad Atif Ali
2023-12-24 11:43:38 +03:00
committed by GitHub
parent efe8c67774
commit ed3ecfc923
+7 -6
View File
@@ -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