From 364678dd9482e5761577e56cf664b571301800cd Mon Sep 17 00:00:00 2001 From: Shane <6071159+smashedr@users.noreply.github.com> Date: Mon, 27 Oct 2025 15:56:10 -0700 Subject: [PATCH 1/6] Test Render --- src/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app.js b/src/app.js index 9caa1b5..8750d2f 100644 --- a/src/app.js +++ b/src/app.js @@ -51,7 +51,7 @@ schedule.scheduleJob('*/5 * * * *', function () { }) const server = app.listen(port, () => { - console.log(`Listening on PORT: ${port}`) + console.log(`Listening on RENDER PORT: ${port}`) // TODO: DEBUGGING ONLY }) process.on('SIGTERM', () => { From e7e654a0cb0b2f3eaee09dd512b9fb00de0b7de3 Mon Sep 17 00:00:00 2001 From: Shane <6071159+smashedr@users.noreply.github.com> Date: Mon, 27 Oct 2025 17:12:38 -0700 Subject: [PATCH 2/6] Add ref to Hook --- .github/workflows/render.yaml | 15 +++++++++++++-- render.yaml | 2 -- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/render.yaml b/.github/workflows/render.yaml index e18efd9..255ab5f 100644 --- a/.github/workflows/render.yaml +++ b/.github/workflows/render.yaml @@ -1,6 +1,7 @@ name: "Render" on: + push: workflow_call: #inputs: # version: @@ -51,12 +52,22 @@ jobs: run: | echo "env.version: ${{ env.version }}" echo "imgURL: ghcr.io/${{ github.repository }}:${{ env.version }}" + echo "ref: ${{ env.version }}" + + ## https://render.com/docs/deploy-hooks#deploying-from-an-image-registry + #- name: "Render Deploy" + # uses: cssnr/web-request-action@v1 + # env: + # version: ${{ env.version == 'master' && 'latest' || env.version }} + # with: + # url: ${{ secrets.RENDER_HOOK }} + # params: '{"imgURL": "ghcr.io/${{ github.repository }}:${{ env.version }}"}' - # https://render.com/docs/deploy-hooks#deploying-from-an-image-registry - name: "Render Deploy" uses: cssnr/web-request-action@v1 env: version: ${{ env.version == 'master' && 'latest' || env.version }} with: url: ${{ secrets.RENDER_HOOK }} - params: '{"imgURL": "ghcr.io/${{ github.repository }}:${{ env.version }}"}' + params: | + ref: ${{ env.version }} diff --git a/render.yaml b/render.yaml index cb06c9d..3232269 100644 --- a/render.yaml +++ b/render.yaml @@ -2,8 +2,6 @@ services: - type: web name: node-badges plan: free - previews: - generation: automatic runtime: docker repo: https://github.com/smashedr/node-badges autoDeployTrigger: off From f5c141f8dd8ffb0bf4b0879a20cb95420c20c9ae Mon Sep 17 00:00:00 2001 From: Shane <6071159+smashedr@users.noreply.github.com> Date: Mon, 27 Oct 2025 17:44:07 -0700 Subject: [PATCH 3/6] Test --- .github/workflows/render.yaml | 2 +- Dockerfile | 2 +- render.yaml | 2 +- src/app.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/render.yaml b/.github/workflows/render.yaml index 255ab5f..a322b81 100644 --- a/.github/workflows/render.yaml +++ b/.github/workflows/render.yaml @@ -1,7 +1,7 @@ name: "Render" on: - push: + #push: workflow_call: #inputs: # version: diff --git a/Dockerfile b/Dockerfile index eb94a67..bb09071 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,7 @@ RUN --mount=type=cache,target=/root/.npm npm ci COPY --chown=node:node ./src ./src -ARG VERSION="Source" +ARG VERSION="Dockerfile" ENV APP_VERSION="${VERSION}" LABEL org.opencontainers.image.version="${VERSION}" diff --git a/render.yaml b/render.yaml index 3232269..587b0c6 100644 --- a/render.yaml +++ b/render.yaml @@ -4,7 +4,7 @@ services: plan: free runtime: docker repo: https://github.com/smashedr/node-badges - autoDeployTrigger: off + autoDeployTrigger: commit dockerCommand: npm start healthCheckPath: /app-health-check envVars: diff --git a/src/app.js b/src/app.js index 8750d2f..9caa1b5 100644 --- a/src/app.js +++ b/src/app.js @@ -51,7 +51,7 @@ schedule.scheduleJob('*/5 * * * *', function () { }) const server = app.listen(port, () => { - console.log(`Listening on RENDER PORT: ${port}`) // TODO: DEBUGGING ONLY + console.log(`Listening on PORT: ${port}`) }) process.on('SIGTERM', () => { From 220b5f01d0ad733b7234bf88395f53c03299982d Mon Sep 17 00:00:00 2001 From: Shane <6071159+smashedr@users.noreply.github.com> Date: Mon, 27 Oct 2025 17:52:05 -0700 Subject: [PATCH 4/6] Test --- .github/workflows/render.yaml | 2 +- render.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/render.yaml b/.github/workflows/render.yaml index a322b81..255ab5f 100644 --- a/.github/workflows/render.yaml +++ b/.github/workflows/render.yaml @@ -1,7 +1,7 @@ name: "Render" on: - #push: + push: workflow_call: #inputs: # version: diff --git a/render.yaml b/render.yaml index 587b0c6..3232269 100644 --- a/render.yaml +++ b/render.yaml @@ -4,7 +4,7 @@ services: plan: free runtime: docker repo: https://github.com/smashedr/node-badges - autoDeployTrigger: commit + autoDeployTrigger: off dockerCommand: npm start healthCheckPath: /app-health-check envVars: From e1f330c677c2d70600f83a73c44be5a8af4c1333 Mon Sep 17 00:00:00 2001 From: Shane <6071159+smashedr@users.noreply.github.com> Date: Mon, 27 Oct 2025 18:22:12 -0700 Subject: [PATCH 5/6] Overhaul Render Workflow - render.yaml --- .github/disabled/render.yaml | 73 +++++++++++++++++++++++++++++++++++ .github/workflows/render.yaml | 41 ++++++++++++-------- 2 files changed, 97 insertions(+), 17 deletions(-) create mode 100644 .github/disabled/render.yaml diff --git a/.github/disabled/render.yaml b/.github/disabled/render.yaml new file mode 100644 index 0000000..255ab5f --- /dev/null +++ b/.github/disabled/render.yaml @@ -0,0 +1,73 @@ +name: "Render" + +on: + push: + workflow_call: + #inputs: + # version: + # description: "Version Tag" + # type: string + workflow_dispatch: + inputs: + version: + description: "Version Tag" + #workflow_run: + # workflows: ["Build"] + # types: [completed] + +env: + version: ${{ inputs.version || github.ref_name }} + +jobs: + render: + #if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} + #if: ${{ github.event.workflow_run.conclusion != '' && github.event.workflow_run.conclusion == 'success' || true }} + name: "Render" + runs-on: ubuntu-latest + timeout-minutes: 5 + + #environment: + # name: render + # url: https://node-badges.onrender.com/ + + steps: + - name: "Debug CTX github" + if: ${{ !github.event.act }} + continue-on-error: true + env: + GITHUB_CTX: ${{ toJSON(github) }} + run: echo "$GITHUB_CTX" + + - name: "Debug 1" + continue-on-error: true + run: | + echo "github.ref_name: ${{ github.ref_name }}" + echo "inputs.version: ${{ inputs.version }}" + echo "env.version: ${{ env.version }}" + + - name: "Debug 2" + continue-on-error: true + env: + version: ${{ env.version == 'master' && 'latest' || env.version }} + run: | + echo "env.version: ${{ env.version }}" + echo "imgURL: ghcr.io/${{ github.repository }}:${{ env.version }}" + echo "ref: ${{ env.version }}" + + ## https://render.com/docs/deploy-hooks#deploying-from-an-image-registry + #- name: "Render Deploy" + # uses: cssnr/web-request-action@v1 + # env: + # version: ${{ env.version == 'master' && 'latest' || env.version }} + # with: + # url: ${{ secrets.RENDER_HOOK }} + # params: '{"imgURL": "ghcr.io/${{ github.repository }}:${{ env.version }}"}' + + - name: "Render Deploy" + uses: cssnr/web-request-action@v1 + env: + version: ${{ env.version == 'master' && 'latest' || env.version }} + with: + url: ${{ secrets.RENDER_HOOK }} + params: | + ref: ${{ env.version }} diff --git a/.github/workflows/render.yaml b/.github/workflows/render.yaml index 255ab5f..7a84e95 100644 --- a/.github/workflows/render.yaml +++ b/.github/workflows/render.yaml @@ -2,6 +2,7 @@ name: "Render" on: push: + branches-ignore: [master] workflow_call: #inputs: # version: @@ -20,15 +21,16 @@ env: jobs: render: + if: ${{ !contains(github.event.head_commit.message, '#norender') }} #if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} #if: ${{ github.event.workflow_run.conclusion != '' && github.event.workflow_run.conclusion == 'success' || true }} name: "Render" runs-on: ubuntu-latest timeout-minutes: 5 - #environment: - # name: render - # url: https://node-badges.onrender.com/ + environment: + name: render + url: https://node-badges.onrender.com/ steps: - name: "Debug CTX github" @@ -38,36 +40,41 @@ jobs: GITHUB_CTX: ${{ toJSON(github) }} run: echo "$GITHUB_CTX" - - name: "Debug 1" + - name: "Debug Branch ref" continue-on-error: true run: | echo "github.ref_name: ${{ github.ref_name }}" echo "inputs.version: ${{ inputs.version }}" echo "env.version: ${{ env.version }}" + echo "--------------------" + echo "ref: ${{ github.ref_name }}" - - name: "Debug 2" + - name: "Debug Image version" continue-on-error: true env: version: ${{ env.version == 'master' && 'latest' || env.version }} run: | + echo "github.ref_name: ${{ github.ref_name }}" + echo "inputs.version: ${{ inputs.version }}" echo "env.version: ${{ env.version }}" + echo "--------------------" echo "imgURL: ghcr.io/${{ github.repository }}:${{ env.version }}" - echo "ref: ${{ env.version }}" - ## https://render.com/docs/deploy-hooks#deploying-from-an-image-registry - #- name: "Render Deploy" - # uses: cssnr/web-request-action@v1 - # env: - # version: ${{ env.version == 'master' && 'latest' || env.version }} - # with: - # url: ${{ secrets.RENDER_HOOK }} - # params: '{"imgURL": "ghcr.io/${{ github.repository }}:${{ env.version }}"}' - - - name: "Render Deploy" + # https://render.com/docs/deploy-hooks#deploying-from-an-image-registry + - name: "Deploy Image" + if: ${{ inputs.version }} uses: cssnr/web-request-action@v1 env: version: ${{ env.version == 'master' && 'latest' || env.version }} with: url: ${{ secrets.RENDER_HOOK }} params: | - ref: ${{ env.version }} + imgURL: ghcr.io/${{ github.repository }}:${{ env.version }} + + - name: "Deploy Branch" + if: ${{ !inputs.version }} + uses: cssnr/web-request-action@v1 + with: + url: ${{ secrets.RENDER_HOOK }} + params: | + ref: ${{ github.ref_name }} From f0acdfa45812a1078761bf2135df98390c9f2a76 Mon Sep 17 00:00:00 2001 From: Shane <6071159+smashedr@users.noreply.github.com> Date: Mon, 27 Oct 2025 18:26:57 -0700 Subject: [PATCH 6/6] Test #norender --- .github/workflows/render.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/render.yaml b/.github/workflows/render.yaml index 7a84e95..4213321 100644 --- a/.github/workflows/render.yaml +++ b/.github/workflows/render.yaml @@ -61,6 +61,7 @@ jobs: echo "imgURL: ghcr.io/${{ github.repository }}:${{ env.version }}" # https://render.com/docs/deploy-hooks#deploying-from-an-image-registry + # NOTE: Confirm we can do image and dockerfile deployments simultaneously... - name: "Deploy Image" if: ${{ inputs.version }} uses: cssnr/web-request-action@v1