Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: update docs automatically on push to main #261

Merged
merged 6 commits into from
Mar 27, 2024
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
name: docs
on:
push:
branches: [ 'main' ]
paths:
- 'docs/**'
- 'charts/zora/values.yaml'
- 'charts/zora/README.md'
workflow_dispatch:
inputs:
version:
Expand All @@ -9,9 +15,6 @@ on:
latest:
description: 'latest'
type: boolean
dev:
description: 'dev'
type: boolean

env:
GIT_USER: "github-actions"
Expand Down Expand Up @@ -39,25 +42,20 @@ jobs:
- name: install mkdocs and mike
run: pip install mkdocs-material mike

- name: set 'latest' alias
if: inputs.latest
run: echo 'alias=latest' >> $GITHUB_ENV

- name: set 'dev' alias
if: inputs.dev
run: echo 'alias=dev' >> $GITHUB_ENV

- name: fetch gh-pages branch
run: |
git config --global user.email "$GIT_EMAIL"
git config --global user.name "$GIT_USER"
git fetch origin gh-pages --depth=1

- name: mike deploy
env:
VERSION: ${{ github.event_name == 'workflow_dispatch' && inputs.version || 'dev' }}
ALIAS: ${{ inputs.latest && 'latest' || '' }}
run: |
cp -f charts/zora/README.md docs/helm-chart.md
cp -f charts/zora/values.yaml docs/values.yaml
mike deploy --update-aliases ${{ inputs.version }} ${{ env.alias }}
mike deploy --update-aliases $VERSION $ALIAS

- name: update titles and push
run: |
Expand Down
Loading