Improve logic to create versioned docs
- Add check to see if we are actually able to build the resulting website - Uploads the created assets to actions artifacts
This commit is contained in:
parent
3b53a79173
commit
c071a28d57
48
.github/workflows/auto-version-docs.yml
vendored
48
.github/workflows/auto-version-docs.yml
vendored
@ -8,16 +8,42 @@ jobs:
|
|||||||
Version-Docs:
|
Version-Docs:
|
||||||
environment: Testing
|
environment: Testing
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
working-directory: website
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup Golang with cache
|
||||||
|
uses: magnetikonline/action-golang-cache@v3
|
||||||
|
with:
|
||||||
|
go-version-file: src/go.mod
|
||||||
|
|
||||||
|
- name: Generate CLI Docs
|
||||||
|
working-directory: ./src
|
||||||
|
run: |
|
||||||
|
go run ./cmd/mdgen/mdgen.go generate
|
||||||
|
|
||||||
|
# migrate generated md files into /website/docs/cli
|
||||||
|
- name: Move CLI .md to Docs
|
||||||
|
run: |
|
||||||
|
mkdir -p ./website/docs/cli
|
||||||
|
mv ./src/cmd/mdgen/cli_markdown/* ./website/docs/cli/
|
||||||
|
rm -R ./src/cmd/mdgen/cli_markdown/
|
||||||
|
|
||||||
|
- name: Install dependencies for website lint
|
||||||
|
run: |
|
||||||
|
wget https://github.com/errata-ai/vale/releases/download/v2.20.2/vale_2.20.2_Linux_64-bit.tar.gz # NOTE: update in Dockerfile when updating
|
||||||
|
mkdir bin && tar -xvzf vale_2.20.2_Linux_64-bit.tar.gz -C bin
|
||||||
|
echo "$PWD/bin" >> $GITHUB_PATH
|
||||||
|
npm i -g markdownlint-cli@0.32.2 # NOTE: update in Dockerfile when updating
|
||||||
|
|
||||||
|
- name: Run website lint
|
||||||
|
run: |
|
||||||
|
cd website && make -o genclidocs localcheck
|
||||||
|
|
||||||
- name: Create new version of docs
|
- name: Create new version of docs
|
||||||
run: |
|
run: |
|
||||||
set -xe
|
set -xe
|
||||||
|
cd website
|
||||||
# export VERSION="$(git describe --exact-match --tags $(git rev-parse HEAD))"
|
# export VERSION="$(git describe --exact-match --tags $(git rev-parse HEAD))"
|
||||||
export VERSION="testing"
|
export VERSION="testing"
|
||||||
npm ci
|
npm ci
|
||||||
@ -29,4 +55,18 @@ jobs:
|
|||||||
commit-message: Add new version to versioned docs
|
commit-message: Add new version to versioned docs
|
||||||
title: Add new version to versioned docs
|
title: Add new version to versioned docs
|
||||||
body: Creates a new versioned set of docs for the latest release to `versioned_docs`.
|
body: Creates a new versioned set of docs for the latest release to `versioned_docs`.
|
||||||
branch: versioned-docs-update
|
branch: versioned-docs-update
|
||||||
|
|
||||||
|
- name: Build website
|
||||||
|
env:
|
||||||
|
CORSO_VERSION: ${{ needs.SetEnv.outputs.version }}
|
||||||
|
run: |
|
||||||
|
cd website &&
|
||||||
|
npm ci &&
|
||||||
|
npm run build
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@master
|
||||||
|
name: Upload website as artifacts
|
||||||
|
with:
|
||||||
|
name: website
|
||||||
|
path: website/build
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user