-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (57 loc) · 1.98 KB
/
generate-specs.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Build 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@v3
- name: Setup node env 🏗
uses: actions/setup-node@v3
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