Skip to content

Commit

Permalink
ci: update docs automatically on push to main (#261)
Browse files Browse the repository at this point in the history
* ci: update docs on push to main
  • Loading branch information
matheusfm authored Mar 27, 2024
1 parent 87d256f commit c654379
Showing 1 changed file with 10 additions and 12 deletions.
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

0 comments on commit c654379

Please sign in to comment.