Skip to content

chatbot-0.1

chatbot-0.1 #27

Workflow file for this run

name: Generate Web Specs
on:
release:
types:
- published
workflow_dispatch:
inputs:
tag:
type: string
required: true
description: Tag to be used for the generated image (should be a valid version)
jobs:
build_web_specs:
runs-on: ubuntu-latest
env:
RELEASE_NAME: "${{ github.ref_name || github.event.inputs.tag }}"
steps:
- name: Check release name matches version pattern
run: |
PATTERN="^([0-9]+\.[0-9]+(\.[0-9]+)?)(-[A-Za-z0-9\.]+)*$"
if [[ $RELEASE_NAME =~ $PATTERN ]]; then
echo "The RELEASE_NAME '$RELEASE_NAME' is valid."
else
echo "The RELEASE_NAME '$RELEASE_NAME' is invalid."
exit 1
fi
- name: Checkout
uses: actions/checkout@v4
- name: Setup node env 🏗
uses: actions/setup-node@v4
with:
node-version: 20
- name: Cache node_modules 📦
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-generator
- name: Install AsyncAPI CLI and Generator 👨🏻‍💻
run: npm i -g @asyncapi/cli @asyncapi/generator
# Use AsyncAPI generator to generate the HTML bundle
- name: Generate docs for Hub Santé interface ⚙️
run: asyncapi generate fromTemplate csv_parser/out/hubsante.asyncapi.yaml @asyncapi/html-template -o web_specs/generated/ --force-write
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push specs website
uses: docker/build-push-action@v5
with:
push: true
platforms: linux/amd64
tags: ghcr.io/${{ github.repository_owner }}/hub-web-specs:${{ env.RELEASE_NAME }}
context: ./web_specs