-
Notifications
You must be signed in to change notification settings - Fork 68
69 lines (64 loc) · 3.19 KB
/
release.yml
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: release
on:
push:
tags:
- '**'
env:
NODE_VERSION: 16
jobs:
release-docker:
runs-on: ubuntu-latest
env:
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
ALGOLIA_INDEX_NAME: ${{ secrets.ALGOLIA_INDEX_NAME }}
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
steps:
- run: echo "BUILD_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with: { node-version: "${{ env.NODE_VERSION }}" }
- name: Checkout corteza
uses: actions/checkout@v3
with:
repository: cortezaproject/corteza
path: corteza
- uses: docker/login-action@v1
if: ${{ !env.ACT }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build corteza-js api docs
run: |
cd corteza/lib/js
yarn add [email protected]
yarn add [email protected]
LATEST=$(git tag -l | grep 2023.9 | sort | tail -n 1) && \
git checkout ${LATEST} && \
npx typedoc --name "Corteza JS 2023.9" --hideGenerator --skipErrorChecking --out corteza-api-docs/corteza-js/2023.9 src/api-clients/index.ts
LATEST=$(git tag -l | grep 2023.3 | sort | tail -n 1) && \
git checkout ${LATEST} && \
npx typedoc --name "Corteza JS 2023.3" --hideGenerator --skipErrorChecking --out corteza-api-docs/corteza-js/2023.3 src/api-clients/index.ts
LATEST=$(git tag -l | grep 2022.9 | sort | tail -n 1) && \
git checkout ${LATEST} && \
npx typedoc --name "Corteza JS 2022.9" --hideGenerator --skipErrorChecking --out corteza-api-docs/corteza-js/2022.9 src/api-clients/index.ts
LATEST=$(git tag -l | grep 2022.3 | sort | tail -n 1) && \
git checkout ${LATEST} && \
npx typedoc --name "Corteza JS 2022.3" --hideGenerator --skipErrorChecking --out corteza-api-docs/corteza-js/2022.3 src/api-clients/index.ts
- name: Build corteza-server api docs
run: |
cd corteza/server
mkdir -p ../lib/js/corteza-api-docs/corteza-server/{2023.9,2023.3,2022.9,2022.3}
LATEST=$(git tag -l | grep 2023.9 | sort | tail -n 1) && \
git checkout ${LATEST} && \
cp -r docs/* ../lib/js/corteza-api-docs/corteza-server/2023.9
LATEST=$(git tag -l | grep 2023.3 | sort | tail -n 1) && \
git checkout ${LATEST} && \
cp -r docs/* ../lib/js/corteza-api-docs/corteza-server/2023.3
LATEST=$(git tag -l | grep 2022.9 | sort | tail -n 1) && \
git checkout ${LATEST} && \
cp -r docs/* ../lib/js/corteza-api-docs/corteza-server/2022.9
LATEST=$(git tag -l | grep 2022.3 | sort | tail -n 1) && \
git checkout ${LATEST} && \
cp -r docs/* ../lib/js/corteza-api-docs/corteza-server/2022.3
- run: docker build --build-arg ALGOLIA_APP_ID="$ALGOLIA_APP_ID" --build-arg ALGOLIA_API_KEY="$ALGOLIA_API_KEY" --build-arg ALGOLIA_INDEX_NAME="$ALGOLIA_INDEX_NAME" -t cortezaproject/corteza-docs:${{ env.BUILD_VERSION }} .
- run: docker push cortezaproject/corteza-docs:${{ env.BUILD_VERSION }}