From c654379d6dd05957cc8c101901a537aa6b776ea0 Mon Sep 17 00:00:00 2001 From: Matheus Moraes Date: Wed, 27 Mar 2024 14:44:10 -0300 Subject: [PATCH] ci: update docs automatically on push to main (#261) * ci: update docs on push to main --- .github/workflows/docs.yaml | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 2c10811a..68ba190a 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -1,5 +1,11 @@ name: docs on: + push: + branches: [ 'main' ] + paths: + - 'docs/**' + - 'charts/zora/values.yaml' + - 'charts/zora/README.md' workflow_dispatch: inputs: version: @@ -9,9 +15,6 @@ on: latest: description: 'latest' type: boolean - dev: - description: 'dev' - type: boolean env: GIT_USER: "github-actions" @@ -39,14 +42,6 @@ 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" @@ -54,10 +49,13 @@ jobs: 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: |