From b75b295749e117d56e6e1cb3688b78e53599d6de Mon Sep 17 00:00:00 2001 From: Aaron Crawfis Date: Wed, 25 Oct 2023 11:26:48 -0700 Subject: [PATCH 1/9] Update issues.yaml --- .github/workflows/issues.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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" From 90e88f77d0527ba56b75ef0e306457e25d54c8bb Mon Sep 17 00:00:00 2001 From: nithyatsu Date: Mon, 30 Oct 2023 09:05:15 -0700 Subject: [PATCH 2/9] conditional push to ghcr --- .github/workflows/build.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 272810c1..60bc6196 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -60,5 +60,7 @@ jobs: uses: docker/build-push-action@v4 with: context: ./${{ matrix.directory }} + context: ./${{ matrix.directory }} + if: github.event_name == 'push' push: ${{ env.PUSH_IMAGE }} tags: ${{ env.CONTAINER_REGISTRY }}/${{ matrix.image }}:${{ env.VERSION }} From ffb2437f76a269fc2c9716223dd8de64e5f64a6b Mon Sep 17 00:00:00 2001 From: nithyatsu Date: Mon, 30 Oct 2023 09:09:45 -0700 Subject: [PATCH 3/9] nit --- .github/workflows/build.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 60bc6196..4ecc0bed 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -60,7 +60,6 @@ jobs: uses: docker/build-push-action@v4 with: context: ./${{ matrix.directory }} - context: ./${{ matrix.directory }} if: github.event_name == 'push' push: ${{ env.PUSH_IMAGE }} tags: ${{ env.CONTAINER_REGISTRY }}/${{ matrix.image }}:${{ env.VERSION }} From 489a442be45f2dd2746610298d8183308c73ecb2 Mon Sep 17 00:00:00 2001 From: nithyatsu Date: Mon, 30 Oct 2023 10:40:25 -0700 Subject: [PATCH 4/9] fix --- .github/workflows/build.yaml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4ecc0bed..1c268216 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 @@ -48,6 +46,15 @@ jobs: - directory: samples/volumes/ image: samples/volumes steps: + - name: Evaluate push + id: eval_push + 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 @@ -56,10 +63,11 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - run: echo "event name is:" ${{ github.event_name }} + - run: echo "event type is:" ${{ github.event.action }} - name: Build and push ${{ matrix.image }} uses: docker/build-push-action@v4 with: context: ./${{ matrix.directory }} - if: github.event_name == 'push' - push: ${{ env.PUSH_IMAGE }} + push: ${{ fromJSON(steps.eval_push.outputs.PUSH_IMAGE) }} tags: ${{ env.CONTAINER_REGISTRY }}/${{ matrix.image }}:${{ env.VERSION }} From 70f248dc602ebb98a49058eb14f3c4212de49cda Mon Sep 17 00:00:00 2001 From: nithyatsu Date: Mon, 30 Oct 2023 10:40:53 -0700 Subject: [PATCH 5/9] nit --- .github/workflows/build.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 1c268216..a2af97b6 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -63,8 +63,6 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - run: echo "event name is:" ${{ github.event_name }} - - run: echo "event type is:" ${{ github.event.action }} - name: Build and push ${{ matrix.image }} uses: docker/build-push-action@v4 with: From 6311e8915251f4408a28885f21ed8dd5e6350a7f Mon Sep 17 00:00:00 2001 From: nithyatsu Date: Mon, 30 Oct 2023 10:44:13 -0700 Subject: [PATCH 6/9] delete az login since unneccessary --- .github/workflows/validate-bicep.yaml | 6 ------ 1 file changed, 6 deletions(-) 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 From 0ed54a9bc1a71e388e9e436bb34ef4c0eb08c446 Mon Sep 17 00:00:00 2001 From: nithyatsu Date: Mon, 30 Oct 2023 10:56:00 -0700 Subject: [PATCH 7/9] add comment --- .github/workflows/build.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index a2af97b6..29505a6d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -57,6 +57,7 @@ jobs: echo "PUSH_IMAGE=${PUSH_IMAGE}" >> $GITHUB_OUTPUT - name: Checkout code uses: actions/checkout@v4 + # Using fromJSON to convert string to boolean. Ref. https://github.com/actions/runner/issues/1483 - name: Login to GitHub Container Registry uses: docker/login-action@v2 with: From de7bc5fff423541b679bec6671acc20163516adf Mon Sep 17 00:00:00 2001 From: nithyatsu Date: Mon, 30 Oct 2023 15:20:12 -0700 Subject: [PATCH 8/9] nit --- .github/workflows/build.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 29505a6d..b90ee60f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -68,5 +68,6 @@ jobs: uses: docker/build-push-action@v4 with: context: ./${{ matrix.directory }} - push: ${{ fromJSON(steps.eval_push.outputs.PUSH_IMAGE) }} + push: ${{ github.event_name == 'push' && true || false }} + # push: ${{ fromJSON(steps.eval_push.outputs.PUSH_IMAGE) }} tags: ${{ env.CONTAINER_REGISTRY }}/${{ matrix.image }}:${{ env.VERSION }} From d68a31eac18c3acf9d6189de678939e35399bed0 Mon Sep 17 00:00:00 2001 From: nithyatsu Date: Mon, 30 Oct 2023 15:37:39 -0700 Subject: [PATCH 9/9] review comments --- .github/workflows/build.yaml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index b90ee60f..9e055d42 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -46,18 +46,8 @@ jobs: - directory: samples/volumes/ image: samples/volumes steps: - - name: Evaluate push - id: eval_push - 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 - # Using fromJSON to convert string to boolean. Ref. https://github.com/actions/runner/issues/1483 - name: Login to GitHub Container Registry uses: docker/login-action@v2 with: @@ -69,5 +59,4 @@ jobs: with: context: ./${{ matrix.directory }} push: ${{ github.event_name == 'push' && true || false }} - # push: ${{ fromJSON(steps.eval_push.outputs.PUSH_IMAGE) }} tags: ${{ env.CONTAINER_REGISTRY }}/${{ matrix.image }}:${{ env.VERSION }}