This action checks the deployment of preview environments featured by Render
Required The name of the Render service to check
The name of the branch deployed by your Render Blueprint (defaults to master
)
The first service deployment URL
"success"
if all your services are up- none otherwise
This action fails if one service deployment has a
failed
state
You need to define an id
for this action to be able to read its outputs later.
jobs:
your_job:
steps:
- uses: actions/check-render-preview@v1
id: wait # <= this is mandatory if you wish to read outputs later in the workflow
Required A valid Github Token with permissions to read this repository's deployments and deployments' statuses
You can find information about how to create a personal access token (PAT) here
- Create a secret in your Repository named
GITHUB_TOKEN
and paste your PAT in the value section - Pass the github token as an env variable in your workflow
# As a global env variable (if you need it elsewhere in your workflow)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# As a local env variable (the recommended way)
jobs:
your_job:
steps:
- uses: actions/check-render-preview@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
You can use this action outputs in another step or in another job that needs it.
jobs:
your_job:
steps:
# Define outputs if you wish to read them in another job
outputs:
env_status: ${{ steps.wait.outputs.env_status }}
env_url: ${{ steps.wait.outputs.env_url }}
- uses: actions/check-render-preview@v1
id: wait
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
SERVICE_NAME: dashboard
- name: 'Check the Dashboard homepage'
# Condition this step to the output of the previous step
if: steps.wait.outputs.env_status == 'success'
uses: lakuapik/gh-actions-http-status@v1
with:
sites: '["${{ steps.wait.outputs.env_url }}"]'
expected: '[200]'
your_other_job:
needs: your_job
# Run this job only if the deployment of your preview environments is successful
if: needs.your_job.outputs.env_status == 'success'