From a3adfe3502b43adbe42fb63cbd32e530827b0358 Mon Sep 17 00:00:00 2001 From: Will <28876888+willtsai@users.noreply.github.com> Date: Fri, 20 Oct 2023 09:12:07 -0700 Subject: [PATCH 01/11] k8s guestbook application example for use in tutorial (#626) * copy over k8s guestbook application example for use in tutorial Signed-off-by: Will Tsai <28876888+willtsai@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Jonathan Smith --------- Signed-off-by: Will Tsai <28876888+willtsai@users.noreply.github.com> Co-authored-by: Jonathan Smith --- samples/README.md | 4 +-- samples/kubernetes/guestbook/README.md | 5 +++ .../guestbook/deploy/frontend-deployment.yaml | 33 +++++++++++++++++ .../guestbook/deploy/frontend-service.yaml | 18 ++++++++++ .../deploy/redis-master-deployment.yaml | 27 ++++++++++++++ .../deploy/redis-master-service.yaml | 16 +++++++++ .../deploy/redis-replica-deployment.yaml | 35 +++++++++++++++++++ .../deploy/redis-replica-service.yaml | 15 ++++++++ 8 files changed, 151 insertions(+), 2 deletions(-) create mode 100644 samples/kubernetes/guestbook/README.md create mode 100644 samples/kubernetes/guestbook/deploy/frontend-deployment.yaml create mode 100644 samples/kubernetes/guestbook/deploy/frontend-service.yaml create mode 100644 samples/kubernetes/guestbook/deploy/redis-master-deployment.yaml create mode 100644 samples/kubernetes/guestbook/deploy/redis-master-service.yaml create mode 100644 samples/kubernetes/guestbook/deploy/redis-replica-deployment.yaml create mode 100644 samples/kubernetes/guestbook/deploy/redis-replica-service.yaml diff --git a/samples/README.md b/samples/README.md index fb0fa912..5c1bd27e 100644 --- a/samples/README.md +++ b/samples/README.md @@ -1,6 +1,6 @@ -# Reference applicatins +# Reference applications -Reference apps are templates that show a complete app. You are able to clone and deploy any of these apps to try out various Project Radius functionality. +Clone and deploy reference applications to learn more about Radius. | Reference app | Description | |---------------|-------------| diff --git a/samples/kubernetes/guestbook/README.md b/samples/kubernetes/guestbook/README.md new file mode 100644 index 00000000..34b0c930 --- /dev/null +++ b/samples/kubernetes/guestbook/README.md @@ -0,0 +1,5 @@ +# Kubernetes Guestbook application example + +This is an example containerized Guestbook application originally authored by the Kubernetes community for use in their own tutorial. The application's Kubernetes deployment manifests copied over from the Kubernetes source [repo](https://github.com/kubernetes/examples/tree/master/guestbook) are contained in the `deploy` directory. + +The Guestbook application consists of a web front end along with primary and secondary Redis containers for storage, all deployed with Kubernetes. For more information about the application and accessing its source code, see the [Kubernetes tutorial](https://kubernetes.io/docs/tutorials/stateless-application/guestbook/) and their [examples repo](https://github.com/kubernetes/examples/tree/master/guestbook). \ No newline at end of file diff --git a/samples/kubernetes/guestbook/deploy/frontend-deployment.yaml b/samples/kubernetes/guestbook/deploy/frontend-deployment.yaml new file mode 100644 index 00000000..2b08cc9d --- /dev/null +++ b/samples/kubernetes/guestbook/deploy/frontend-deployment.yaml @@ -0,0 +1,33 @@ +apiVersion: apps/v1 # for k8s versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use extensions/v1beta1 +kind: Deployment +metadata: + name: frontend +spec: + selector: + matchLabels: + app: guestbook + tier: frontend + replicas: 3 + template: + metadata: + labels: + app: guestbook + tier: frontend + spec: + containers: + - name: php-redis + image: gcr.io/google-samples/gb-frontend:v4 + resources: + requests: + cpu: 100m + memory: 100Mi + env: + - name: GET_HOSTS_FROM + value: dns + # If your cluster config does not include a dns service, then to + # instead access environment variables to find service host + # info, comment out the 'value: dns' line above, and uncomment the + # line below: + # value: env + ports: + - containerPort: 80 diff --git a/samples/kubernetes/guestbook/deploy/frontend-service.yaml b/samples/kubernetes/guestbook/deploy/frontend-service.yaml new file mode 100644 index 00000000..dca33530 --- /dev/null +++ b/samples/kubernetes/guestbook/deploy/frontend-service.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +kind: Service +metadata: + name: frontend + labels: + app: guestbook + tier: frontend +spec: + # comment or delete the following line if you want to use a LoadBalancer + type: NodePort + # if your cluster supports it, uncomment the following to automatically create + # an external load-balanced IP for the frontend service. + # type: LoadBalancer + ports: + - port: 80 + selector: + app: guestbook + tier: frontend diff --git a/samples/kubernetes/guestbook/deploy/redis-master-deployment.yaml b/samples/kubernetes/guestbook/deploy/redis-master-deployment.yaml new file mode 100644 index 00000000..5a76f05d --- /dev/null +++ b/samples/kubernetes/guestbook/deploy/redis-master-deployment.yaml @@ -0,0 +1,27 @@ +apiVersion: apps/v1 # for k8s versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use extensions/v1beta1 +kind: Deployment +metadata: + name: redis-master +spec: + selector: + matchLabels: + app: redis + role: master + tier: backend + replicas: 1 + template: + metadata: + labels: + app: redis + role: master + tier: backend + spec: + containers: + - name: master + image: registry.k8s.io/redis:e2e # or just image: redis + resources: + requests: + cpu: 100m + memory: 100Mi + ports: + - containerPort: 6379 diff --git a/samples/kubernetes/guestbook/deploy/redis-master-service.yaml b/samples/kubernetes/guestbook/deploy/redis-master-service.yaml new file mode 100644 index 00000000..a484014f --- /dev/null +++ b/samples/kubernetes/guestbook/deploy/redis-master-service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: redis-master + labels: + app: redis + role: master + tier: backend +spec: + ports: + - port: 6379 + targetPort: 6379 + selector: + app: redis + role: master + tier: backend diff --git a/samples/kubernetes/guestbook/deploy/redis-replica-deployment.yaml b/samples/kubernetes/guestbook/deploy/redis-replica-deployment.yaml new file mode 100644 index 00000000..c1e8ca31 --- /dev/null +++ b/samples/kubernetes/guestbook/deploy/redis-replica-deployment.yaml @@ -0,0 +1,35 @@ +apiVersion: apps/v1 # for k8s versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use extensions/v1beta1 +kind: Deployment +metadata: + name: redis-replica +spec: + selector: + matchLabels: + app: redis + role: replica + tier: backend + replicas: 2 + template: + metadata: + labels: + app: redis + role: replica + tier: backend + spec: + containers: + - name: slave + image: gcr.io/google_samples/gb-redisslave:v1 + resources: + requests: + cpu: 100m + memory: 100Mi + env: + - name: GET_HOSTS_FROM + value: dns + # If your cluster config does not include a dns service, then to + # instead access an environment variable to find the master + # service's host, comment out the 'value: dns' line above, and + # uncomment the line below: + # value: env + ports: + - containerPort: 6379 diff --git a/samples/kubernetes/guestbook/deploy/redis-replica-service.yaml b/samples/kubernetes/guestbook/deploy/redis-replica-service.yaml new file mode 100644 index 00000000..90172bbf --- /dev/null +++ b/samples/kubernetes/guestbook/deploy/redis-replica-service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: redis-replica + labels: + app: redis + role: replica + tier: backend +spec: + ports: + - port: 6379 + selector: + app: redis + role: replica + tier: backend From 86f157a12fcbd98a96dff4946d82d6590459c9d0 Mon Sep 17 00:00:00 2001 From: Reshma Abdul Rahim <61033581+Reshrahim@users.noreply.github.com> Date: Tue, 24 Oct 2023 16:31:43 -0400 Subject: [PATCH 02/11] Upmerge 10-24 (#695) * Update get.radapp.dev references (#625) * Update get.radapp.dev refernces * Update vscode extension install * Update eShop Readme with new url links (#647) * Fix edge version download (#685) * Add Kuberenetes tutorial content (#620) * Add Kuberenetes tutorial content * Update demo/Chart/values.yaml Co-authored-by: Aaron Crawfis * Update demo/Chart/values.yaml Co-authored-by: Aaron Crawfis * k8s guestbook application example for use in tutorial (#626) * copy over k8s guestbook application example for use in tutorial Signed-off-by: Will Tsai <28876888+willtsai@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Jonathan Smith --------- Signed-off-by: Will Tsai <28876888+willtsai@users.noreply.github.com> Co-authored-by: Jonathan Smith * Rebase to v0.26 * move chat templatesto samples --------- Signed-off-by: Will Tsai <28876888+willtsai@users.noreply.github.com> Co-authored-by: Aaron Crawfis Co-authored-by: Will <28876888+willtsai@users.noreply.github.com> Co-authored-by: Jonathan Smith Co-authored-by: Reshma Abdul Rahim Co-authored-by: Reshma Abdul Rahim <61033581+Reshrahim@users.noreply.github.com> * Revert changes to test.yaml --------- Signed-off-by: Aaron Crawfis Signed-off-by: Will Tsai <28876888+willtsai@users.noreply.github.com> Co-authored-by: Aaron Crawfis Co-authored-by: James Montemagno Co-authored-by: Ryan Nowak Co-authored-by: Will <28876888+willtsai@users.noreply.github.com> Co-authored-by: Jonathan Smith --- .devcontainer/devcontainer.json | 2 +- .devcontainer/on-create.sh | 7 ++----- .gitattributes | 3 ++- .github/workflows/test.yaml | 2 +- samples/demo/Chart/Chart.yaml | 5 +++++ samples/demo/Chart/templates/app.yaml | 25 +++++++++++++++++++++++++ samples/demo/Chart/values.yaml | 3 +++ samples/eshop/README.md | 8 ++++---- 8 files changed, 43 insertions(+), 12 deletions(-) create mode 100644 samples/demo/Chart/Chart.yaml create mode 100644 samples/demo/Chart/templates/app.yaml create mode 100644 samples/demo/Chart/values.yaml diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index cd43a462..fe248053 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -27,7 +27,7 @@ "ms-python.python", "dunn.redis", "GitHub.copilot", - "/tmp/rad-vscode-bicep.vsix" + "ms-azuretools.rad-vscode-bicep" ] } }, diff --git a/.devcontainer/on-create.sh b/.devcontainer/on-create.sh index 14a38636..ed604f31 100644 --- a/.devcontainer/on-create.sh +++ b/.devcontainer/on-create.sh @@ -16,10 +16,7 @@ else fi if [ "$RADIUS_VERSION" = "edge" ]; then - wget -q "https://get.radapp.dev/tools/rad/install.sh" -O - | /bin/bash -s edge + wget -q "https://raw.githubusercontent.com/radius-project/radius/main/deploy/install.sh" -O - | /bin/bash -s edge else - wget -q "https://get.radapp.dev/tools/rad/install.sh" -O - | /bin/bash + wget -q "https://raw.githubusercontent.com/radius-project/radius/main/deploy/install.sh" -O - | /bin/bash fi - -## Download Bicep extension -curl https://get.radapp.dev/tools/vscode-extensibility/$RADIUS_VERSION/rad-vscode-bicep.vsix --output /tmp/rad-vscode-bicep.vsix \ No newline at end of file diff --git a/.gitattributes b/.gitattributes index b0de1df1..dc9cbb5d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,5 @@ # text files use OS defaults on checkout, LF on checkin * text eol=auto # images are binary -*.png binary \ No newline at end of file +*.png binary +*.ico binary \ No newline at end of file diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ac84ef97..8b3853d5 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -23,7 +23,7 @@ on: schedule: # 7:45 AM Pacific Time - cron: "45 15 * * *" env: - RAD_CLI_URL: https://get.radapp.dev/tools/rad/install.sh + RAD_CLI_URL: https://raw.githubusercontent.com/radius-project/radius/main/deploy/install.sh RUN_IDENTIFIER: samplestest-${{ github.run_id }}-${{ github.run_attempt }} jobs: test: diff --git a/samples/demo/Chart/Chart.yaml b/samples/demo/Chart/Chart.yaml new file mode 100644 index 00000000..19a18b9d --- /dev/null +++ b/samples/demo/Chart/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +appVersion: "0.1.0" +version: 0.1.0 +name: demo +description: A Helm chart for the Radius demo application. \ No newline at end of file diff --git a/samples/demo/Chart/templates/app.yaml b/samples/demo/Chart/templates/app.yaml new file mode 100644 index 00000000..c9c62e11 --- /dev/null +++ b/samples/demo/Chart/templates/app.yaml @@ -0,0 +1,25 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: webapp + namespace: {{ .Release.Namespace }} +spec: + selector: + matchLabels: + app: webapp + template: + metadata: + labels: + app: webapp + spec: + containers: + - name: webapp + image: {{ .Values.image.repository }}:{{ .Values.image.tag }} + env: + - name: CONNECTION_REDIS_URL + valueFrom: + secretKeyRef: + name: redis-secret + key: url + ports: + - containerPort: 3000 \ No newline at end of file diff --git a/samples/demo/Chart/values.yaml b/samples/demo/Chart/values.yaml new file mode 100644 index 00000000..9751b981 --- /dev/null +++ b/samples/demo/Chart/values.yaml @@ -0,0 +1,3 @@ +image: + repository: ghcr.io/radius-project/samples/demo + tag: latest \ No newline at end of file diff --git a/samples/eshop/README.md b/samples/eshop/README.md index f858478c..a8869007 100644 --- a/samples/eshop/README.md +++ b/samples/eshop/README.md @@ -1,6 +1,6 @@ # eShop on Radius reference application -Visit the [Project Radius docs](https://radapp.dev/getting-started/reference-apps/eshop/) to learn more and try it out. +Visit the [Project Radius docs](https://docs.radapp.io/tutorials/eshop/) to learn more and try it out. ## Source @@ -8,10 +8,10 @@ This reference app is a "radified" version of the [eShop on containers](https:// ## Deploy -1. Have a kubernetes cluster handy from the [supported clusters](https://docs.radapp.dev/operations/platforms/kubernetes/supported-clusters/). +1. Have a kubernetes cluster handy from the [supported clusters](https://docs.radapp.io/guides/operations/kubernetes/overview/#supported-kubernetes-clusters). - (AWS only) Make sure that each of the Subnets in your EKS cluster Subnet Group are within the list of [supported MemoryDB availability zones](https://docs.aws.amazon.com/memorydb/latest/devguide/subnetgroups.html) -1. [Install the rad CLI](https://radapp.dev/getting-started/) -1. [Initialize a new Radius environment](https://radapp.dev/getting-started/) +1. [Install the rad CLI](https://docs.radapp.io/getting-started/) +1. [Initialize a new Radius environment](https://docs.radapp.io/getting-started/) 1. Clone the repository and switch to the app directory: ```bash git clone https://github.com/radius-project/samples.git From 3b5c02057ef79c37b63fe60db3afc7c200aba55a Mon Sep 17 00:00:00 2001 From: jasonviviano <83607984+jasonviviano@users.noreply.github.com> Date: Tue, 24 Oct 2023 13:46:01 -0700 Subject: [PATCH 03/11] Added a condition to allow Docker to fully setup during post-create before initializing the K3d cluster (#694) Co-authored-by: Reshma Abdul Rahim <61033581+Reshrahim@users.noreply.github.com> --- .devcontainer/post-create.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh index 44826f18..26e3a7ee 100644 --- a/.devcontainer/post-create.sh +++ b/.devcontainer/post-create.sh @@ -1,8 +1,13 @@ #!/bin/sh ## Create a k3d cluster -k3d cluster delete -k3d cluster create -p '8081:80@loadbalancer' --k3s-arg '--disable=traefik@server:0' +while (! kubectl cluster-info ); do + # Docker takes a few seconds to initialize + echo "Waiting for Docker to launch..." + k3d cluster delete + k3d cluster create -p '8081:80@loadbalancer' --k3s-arg '--disable=traefik@server:0' + sleep 1 +done ## Install Dapr and init wget -q https://raw.githubusercontent.com/dapr/cli/master/install/install.sh -O - | /bin/bash From 90e88f77d0527ba56b75ef0e306457e25d54c8bb Mon Sep 17 00:00:00 2001 From: nithyatsu Date: Mon, 30 Oct 2023 09:05:15 -0700 Subject: [PATCH 04/11] 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 05/11] 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 06/11] 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 07/11] 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 08/11] 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 09/11] 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 10/11] 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 11/11] 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 }}