Skip to content

chore: Better error messages in ideascale importer | NPG-7753 #2639

chore: Better error messages in ideascale importer | NPG-7753

chore: Better error messages in ideascale importer | NPG-7753 #2639

Workflow file for this run

name: GitHub Pages
on: [push, pull_request]
jobs:
deploy:
name: Deploy GitHub Pages
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write # To create a PR from that branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Service containers to run
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres:14
# Provide the password for postgres
env:
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
kroki:
image: yuzutech/kroki
env:
KROKI_BLOCKDIAG_HOST: blockdiag
KROKI_MERMAID_HOST: mermaid
KROKI_BPMN_HOST: bpmn
KROKI_EXCALIDRAW_HOST: excalidraw
KROKI_SAFE_MODE: unsafe
KROKI_MAX_URI_LENGTH: 64000
ports:
- "7123:8000"
blockdiag:
image: yuzutech/kroki-blockdiag
ports:
- "8001:8001"
mermaid:
image: yuzutech/kroki-mermaid
ports:
- "8002:8002"
bpmn:
image: yuzutech/kroki-bpmn
ports:
- "8003:8003"
excalidraw:
image: yuzutech/kroki-excalidraw
ports:
- "8004:8004"
steps:
- name: Checkout The Code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set env
run: |
GIT_BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
echo "GIT_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV
echo "PGHOST=postgres" >> $GITHUB_ENV
echo "PGPASSWORD=postgres" >> $GITHUB_ENV
- name: Build Docs
uses: docker://ghcr.io/input-output-hk/catalyst-gh-tools:v1.4.3
with:
driver-opts: network=host
entrypoint: cargo
args: make build-docs -U postgres
# On PUSH or PR we deploy docs to a sub-directory named after the branch.
# This lets us review the docs as rendered, and not just the markdown.
- name: Deploy Docs
id: deployAttempt
continue-on-error: true
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./book/html
destination_dir: ${{ env.GIT_BRANCH }}
# This might fail if we try and deploy multiple pages at once.
# So, check if it did, and retry.
# Retry #1
- name: Delay On Failure To Deploy
id: deployRetryWait1
if: steps.deployAttempt.outcome == 'failure'
run: |
sleep $[ ( $RANDOM % 10 ) + 1 ]s
shell: bash
- name: Deploy Docs
id: deployRetry1
if: steps.deployAttempt.outcome == 'failure'
continue-on-error: true
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./book/html
destination_dir: ${{ env.GIT_BRANCH }}
# Retry #2
- name: Delay On Failure To Deploy
id: deployRetryWait2
if: steps.deployRetry1.outcome == 'failure'
run: |
sleep $[ ( $RANDOM % 10 ) + 1 ]s
shell: bash
- name: Deploy Docs
id: deployRetry2
if: steps.deployRetry1.outcome == 'failure'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./book/html
destination_dir: ${{ env.GIT_BRANCH }}
- name: Stop containers
if: always()
run: docker-compose -f "utilities/kroki-service/docker-compose.yml" down