Skip to content

Commit

Permalink
Update container build to only push on merges (#717)
Browse files Browse the repository at this point in the history
* Update issues.yaml

* conditional push to ghcr

* nit

* fix

* nit

* delete az login since unneccessary

* add comment

* nit

* review comments

---------

Signed-off-by: Aaron Crawfis <Aaron.Crawfis@microsoft.com>
Co-authored-by: Aaron Crawfis <Aaron.Crawfis@microsoft.com>
  • Loading branch information
nithyatsu and AaronCrawfis authored Oct 31, 2023
1 parent b7da4a4 commit 4e2561b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
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 }}
tags: ${{ env.CONTAINER_REGISTRY }}/${{ matrix.image }}:${{ env.VERSION }}
3 changes: 2 additions & 1 deletion .github/workflows/issues.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@ jobs:
name: Sync issue to Azure DevOps
runs-on: ubuntu-latest
steps:
- uses: danhellem/github-actions-issue-to-work-item@v2.0
- uses: danhellem/github-actions-issue-to-work-item@v2.1
env:
ado_token: "${{ secrets.ADO_AOCTO_BOT_TOKEN }}"
github_token: "${{ secrets.GH_RAD_CI_BOT_PAT }}"
ado_organization: "azure-octo"
ado_project: "Incubations"
ado_area_path: "Incubations\\Radius"
ado_iteration_path: "Incubations\\Radius"
ado_wit: "GitHub Issue"
ado_new_state: "New"
ado_active_state: "Active"
ado_close_state: "Closed"
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

0 comments on commit 4e2561b

Please sign in to comment.