Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
nithyatsu committed Oct 30, 2023
1 parent 6fa3789 commit e52ccc5
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 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 All @@ -48,6 +46,15 @@ jobs:
- directory: samples/volumes/
image: samples/volumes
steps:
- name: Evaluate PUSH_IMAGE
id: eval_push_image
run: |
if [[ "${{ github.event_name }}" == "push"]]; then
PUSH_IMAGE=true
else
PUSH_IMAGE=false
fi
echo "PUSH_IMAGE=${PUSH_IMAGE}" >> $GITHUB_OUTPUT
- name: Checkout code
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
Expand All @@ -62,5 +69,5 @@ jobs:
uses: docker/build-push-action@v4
with:
context: ./${{ matrix.directory }}
push: github.event_name == 'push'
push: steps.eval_push_image.outputs.PUSH_IMAGE
tags: ${{ env.CONTAINER_REGISTRY }}/${{ matrix.image }}:${{ env.VERSION }}

0 comments on commit e52ccc5

Please sign in to comment.