From b93aac3b1f9e586d0f9fac60999add3a21b1e0b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles-Edouard=20Br=C3=A9t=C3=A9ch=C3=A9?= Date: Sat, 9 Mar 2024 15:16:12 +0100 Subject: [PATCH] feat: publish docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Charles-Edouard Brétéché --- .github/workflows/docs-main.yaml | 39 ++++++++++++++++++++ .github/workflows/docs-release.yaml | 45 +++++++++++++++++++++++ .gitignore | 56 +---------------------------- 3 files changed, 85 insertions(+), 55 deletions(-) create mode 100644 .github/workflows/docs-main.yaml create mode 100644 .github/workflows/docs-release.yaml diff --git a/.github/workflows/docs-main.yaml b/.github/workflows/docs-main.yaml new file mode 100644 index 00000000..ba733ad1 --- /dev/null +++ b/.github/workflows/docs-main.yaml @@ -0,0 +1,39 @@ +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json + +name: Dev docs + +permissions: {} + +on: + push: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + docs: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + # - name: Setup Go + # uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 + # with: + # go-version-file: go.mod + # cache-dependency-path: go.sum + - name: Build site + run: | + set -e + make codegen-mkdocs + - name: Deploy site + run: | + set -e + git fetch origin gh-pages --depth=1 + git config user.name ci-bot + git config user.email ci-bot@example.com + mike deploy -F ./website/mkdocs.yaml --push --update-aliases main dev diff --git a/.github/workflows/docs-release.yaml b/.github/workflows/docs-release.yaml new file mode 100644 index 00000000..9f2a8ece --- /dev/null +++ b/.github/workflows/docs-release.yaml @@ -0,0 +1,45 @@ +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json + +name: Release docs + +permissions: {} + +on: + push: + tags: + - 'docs-v*' + +jobs: + docs: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Parse semver string + id: semver + uses: booxmedialtd/ws-action-parse-semver@7784200024d6b3fc01253e617ec0168daf603de3 # v1.4.7 + with: + input_string: ${{ github.ref_name }} + version_extractor_regex: '^docs-v(.*)$' + - name: Checkout + if: ${{ steps.semver.outputs.prerelease == '' }} + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + # - name: Setup Go + # uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 + # if: ${{ steps.semver.outputs.prerelease == '' }} + # with: + # go-version-file: go.mod + # cache-dependency-path: go.sum + - name: Build site + if: ${{ steps.semver.outputs.prerelease == '' }} + run: | + set -e + make codegen-mkdocs + - name: Deploy site + if: ${{ steps.semver.outputs.prerelease == '' }} + run: | + set -e + git fetch origin gh-pages --depth=1 + git config user.name ci-bot + git config user.email ci-bot@example.com + mike deploy -F ./website/mkdocs.yaml --push --update-aliases ${{ steps.semver.outputs.fullversion }} latest diff --git a/.gitignore b/.gitignore index e7f93619..ace114dc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,55 +1 @@ -website/site/404.html -website/site/index.html -website/site/sitemap.xml -website/site/sitemap.xml.gz -website/site/assets/images/favicon.png -website/site/assets/javascripts/bundle.c8d2eff1.min.js -website/site/assets/javascripts/bundle.c8d2eff1.min.js.map -website/site/assets/javascripts/lunr/tinyseg.js -website/site/assets/javascripts/lunr/wordcut.js -website/site/assets/javascripts/lunr/min/lunr.ar.min.js -website/site/assets/javascripts/lunr/min/lunr.da.min.js -website/site/assets/javascripts/lunr/min/lunr.de.min.js -website/site/assets/javascripts/lunr/min/lunr.du.min.js -website/site/assets/javascripts/lunr/min/lunr.el.min.js -website/site/assets/javascripts/lunr/min/lunr.es.min.js -website/site/assets/javascripts/lunr/min/lunr.fi.min.js -website/site/assets/javascripts/lunr/min/lunr.fr.min.js -website/site/assets/javascripts/lunr/min/lunr.he.min.js -website/site/assets/javascripts/lunr/min/lunr.hi.min.js -website/site/assets/javascripts/lunr/min/lunr.hu.min.js -website/site/assets/javascripts/lunr/min/lunr.hy.min.js -website/site/assets/javascripts/lunr/min/lunr.it.min.js -website/site/assets/javascripts/lunr/min/lunr.ja.min.js -website/site/assets/javascripts/lunr/min/lunr.jp.min.js -website/site/assets/javascripts/lunr/min/lunr.kn.min.js -website/site/assets/javascripts/lunr/min/lunr.ko.min.js -website/site/assets/javascripts/lunr/min/lunr.multi.min.js -website/site/assets/javascripts/lunr/min/lunr.nl.min.js -website/site/assets/javascripts/lunr/min/lunr.no.min.js -website/site/assets/javascripts/lunr/min/lunr.pt.min.js -website/site/assets/javascripts/lunr/min/lunr.ro.min.js -website/site/assets/javascripts/lunr/min/lunr.ru.min.js -website/site/assets/javascripts/lunr/min/lunr.sa.min.js -website/site/assets/javascripts/lunr/min/lunr.stemmer.support.min.js -website/site/assets/javascripts/lunr/min/lunr.sv.min.js -website/site/assets/javascripts/lunr/min/lunr.ta.min.js -website/site/assets/javascripts/lunr/min/lunr.te.min.js -website/site/assets/javascripts/lunr/min/lunr.th.min.js -website/site/assets/javascripts/lunr/min/lunr.tr.min.js -website/site/assets/javascripts/lunr/min/lunr.vi.min.js -website/site/assets/javascripts/lunr/min/lunr.zh.min.js -website/site/assets/javascripts/workers/search.b8dbb3d2.min.js -website/site/assets/javascripts/workers/search.b8dbb3d2.min.js.map -website/site/assets/stylesheets/main.7e359304.min.css -website/site/assets/stylesheets/main.7e359304.min.css.map -website/site/assets/stylesheets/palette.06af60db.min.css -website/site/assets/stylesheets/palette.06af60db.min.css.map -website/site/blog/index.html -website/site/overrides/home.html -website/site/overrides/main.html -website/site/search/search_index.json -website/site/static/extra.css -website/site/static/favicon.ico -website/site/static/kyverno-chainsaw-horizontal.png -website/site/static/kyverno-chainsaw-logo.png +website/site/