From 4e2561b07183fd59f9d6aeb126151ebca29ee35e Mon Sep 17 00:00:00 2001 From: Nithya Subramanian <98416062+nithyatsu@users.noreply.github.com> Date: Tue, 31 Oct 2023 08:46:02 -0700 Subject: [PATCH] Update container build to only push on merges (#717) * 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 Co-authored-by: Aaron Crawfis --- .github/workflows/build.yaml | 6 ++---- .github/workflows/issues.yaml | 3 ++- .github/workflows/validate-bicep.yaml | 6 ------ 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 272810c1..9e055d42 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -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 @@ -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 }} diff --git a/.github/workflows/issues.yaml b/.github/workflows/issues.yaml index e0dccd94..659aa5d1 100644 --- a/.github/workflows/issues.yaml +++ b/.github/workflows/issues.yaml @@ -38,7 +38,7 @@ 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 }}" @@ -46,6 +46,7 @@ jobs: 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" diff --git a/.github/workflows/validate-bicep.yaml b/.github/workflows/validate-bicep.yaml index 0e53d6fa..14e817d7 100644 --- a/.github/workflows/validate-bicep.yaml +++ b/.github/workflows/validate-bicep.yaml @@ -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