Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update container build to only push on merges #717

Merged
merged 10 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ env:
VERSION: ${{ github.event.pull_request.number || 'latest' }}
# Use ghcr.io/radius-project/dev for PR build. Otherwise, use ghcr.io/radius-project.
CONTAINER_REGISTRY: ${{ github.event.pull_request.number && 'ghcr.io/radius-project/dev' || 'ghcr.io/radius-project' }}
# Set to true to push images to registry.
PUSH_IMAGE: true


jobs:
build-ghcr:
name: Build and push sample images to GHCR
Expand Down Expand Up @@ -60,5 +58,5 @@ jobs:
uses: docker/build-push-action@v4
with:
context: ./${{ matrix.directory }}
push: ${{ env.PUSH_IMAGE }}
push: ${{ github.event_name == 'push' && true || false }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this just be ${{ github.event_name == 'push' }}?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That did not work, which is why I used the fromJSON originally (actions/runner#1483). But Aaron's suggestion works.

tags: ${{ env.CONTAINER_REGISTRY }}/${{ matrix.image }}:${{ env.VERSION }}
6 changes: 0 additions & 6 deletions .github/workflows/validate-bicep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ jobs:
steps:
- name: Check out repo
uses: actions/checkout@v2
- name: az CLI login
run: |
az login --service-principal \
--username ${{ secrets.AZURE_SP_TESTS_APPID }} \
--password ${{ secrets.AZURE_SP_TESTS_PASSWORD }} \
--tenant ${{ secrets.AZURE_SP_TESTS_TENANTID }}
- name: Parse release version and set environment variables
run: python ./.github/scripts/get_docs_version.py
- name: Download rad-bicep
Expand Down
Loading