Skip to content

Commit e1f330c

Browse files
committed
Overhaul Render Workflow - render.yaml
1 parent 220b5f0 commit e1f330c

2 files changed

Lines changed: 97 additions & 17 deletions

File tree

.github/disabled/render.yaml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: "Render"
2+
3+
on:
4+
push:
5+
workflow_call:
6+
#inputs:
7+
# version:
8+
# description: "Version Tag"
9+
# type: string
10+
workflow_dispatch:
11+
inputs:
12+
version:
13+
description: "Version Tag"
14+
#workflow_run:
15+
# workflows: ["Build"]
16+
# types: [completed]
17+
18+
env:
19+
version: ${{ inputs.version || github.ref_name }}
20+
21+
jobs:
22+
render:
23+
#if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
24+
#if: ${{ github.event.workflow_run.conclusion != '' && github.event.workflow_run.conclusion == 'success' || true }}
25+
name: "Render"
26+
runs-on: ubuntu-latest
27+
timeout-minutes: 5
28+
29+
#environment:
30+
# name: render
31+
# url: https://node-badges.onrender.com/
32+
33+
steps:
34+
- name: "Debug CTX github"
35+
if: ${{ !github.event.act }}
36+
continue-on-error: true
37+
env:
38+
GITHUB_CTX: ${{ toJSON(github) }}
39+
run: echo "$GITHUB_CTX"
40+
41+
- name: "Debug 1"
42+
continue-on-error: true
43+
run: |
44+
echo "github.ref_name: ${{ github.ref_name }}"
45+
echo "inputs.version: ${{ inputs.version }}"
46+
echo "env.version: ${{ env.version }}"
47+
48+
- name: "Debug 2"
49+
continue-on-error: true
50+
env:
51+
version: ${{ env.version == 'master' && 'latest' || env.version }}
52+
run: |
53+
echo "env.version: ${{ env.version }}"
54+
echo "imgURL: ghcr.io/${{ github.repository }}:${{ env.version }}"
55+
echo "ref: ${{ env.version }}"
56+
57+
## https://render.com/docs/deploy-hooks#deploying-from-an-image-registry
58+
#- name: "Render Deploy"
59+
# uses: cssnr/web-request-action@v1
60+
# env:
61+
# version: ${{ env.version == 'master' && 'latest' || env.version }}
62+
# with:
63+
# url: ${{ secrets.RENDER_HOOK }}
64+
# params: '{"imgURL": "ghcr.io/${{ github.repository }}:${{ env.version }}"}'
65+
66+
- name: "Render Deploy"
67+
uses: cssnr/web-request-action@v1
68+
env:
69+
version: ${{ env.version == 'master' && 'latest' || env.version }}
70+
with:
71+
url: ${{ secrets.RENDER_HOOK }}
72+
params: |
73+
ref: ${{ env.version }}

.github/workflows/render.yaml

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: "Render"
22

33
on:
44
push:
5+
branches-ignore: [master]
56
workflow_call:
67
#inputs:
78
# version:
@@ -20,15 +21,16 @@ env:
2021

2122
jobs:
2223
render:
24+
if: ${{ !contains(github.event.head_commit.message, '#norender') }}
2325
#if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
2426
#if: ${{ github.event.workflow_run.conclusion != '' && github.event.workflow_run.conclusion == 'success' || true }}
2527
name: "Render"
2628
runs-on: ubuntu-latest
2729
timeout-minutes: 5
2830

29-
#environment:
30-
# name: render
31-
# url: https://node-badges.onrender.com/
31+
environment:
32+
name: render
33+
url: https://node-badges.onrender.com/
3234

3335
steps:
3436
- name: "Debug CTX github"
@@ -38,36 +40,41 @@ jobs:
3840
GITHUB_CTX: ${{ toJSON(github) }}
3941
run: echo "$GITHUB_CTX"
4042

41-
- name: "Debug 1"
43+
- name: "Debug Branch ref"
4244
continue-on-error: true
4345
run: |
4446
echo "github.ref_name: ${{ github.ref_name }}"
4547
echo "inputs.version: ${{ inputs.version }}"
4648
echo "env.version: ${{ env.version }}"
49+
echo "--------------------"
50+
echo "ref: ${{ github.ref_name }}"
4751
48-
- name: "Debug 2"
52+
- name: "Debug Image version"
4953
continue-on-error: true
5054
env:
5155
version: ${{ env.version == 'master' && 'latest' || env.version }}
5256
run: |
57+
echo "github.ref_name: ${{ github.ref_name }}"
58+
echo "inputs.version: ${{ inputs.version }}"
5359
echo "env.version: ${{ env.version }}"
60+
echo "--------------------"
5461
echo "imgURL: ghcr.io/${{ github.repository }}:${{ env.version }}"
55-
echo "ref: ${{ env.version }}"
5662
57-
## https://render.com/docs/deploy-hooks#deploying-from-an-image-registry
58-
#- name: "Render Deploy"
59-
# uses: cssnr/web-request-action@v1
60-
# env:
61-
# version: ${{ env.version == 'master' && 'latest' || env.version }}
62-
# with:
63-
# url: ${{ secrets.RENDER_HOOK }}
64-
# params: '{"imgURL": "ghcr.io/${{ github.repository }}:${{ env.version }}"}'
65-
66-
- name: "Render Deploy"
63+
# https://render.com/docs/deploy-hooks#deploying-from-an-image-registry
64+
- name: "Deploy Image"
65+
if: ${{ inputs.version }}
6766
uses: cssnr/web-request-action@v1
6867
env:
6968
version: ${{ env.version == 'master' && 'latest' || env.version }}
7069
with:
7170
url: ${{ secrets.RENDER_HOOK }}
7271
params: |
73-
ref: ${{ env.version }}
72+
imgURL: ghcr.io/${{ github.repository }}:${{ env.version }}
73+
74+
- name: "Deploy Branch"
75+
if: ${{ !inputs.version }}
76+
uses: cssnr/web-request-action@v1
77+
with:
78+
url: ${{ secrets.RENDER_HOOK }}
79+
params: |
80+
ref: ${{ github.ref_name }}

0 commit comments

Comments
 (0)