Merge pull request #240 from VictoriaMetrics/docs-typo #42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: update docs | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - .github/workflows/docs.yaml | |
| - README.md | |
| - docs/** | |
| jobs: | |
| update-docs: | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: docs | |
| url: https://docs.victoriametrics.com/ | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| with: | |
| path: __vl-datasource | |
| - name: Check out VM code | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: VictoriaMetrics/vmdocs | |
| ref: main | |
| token: ${{ secrets.VM_BOT_GH_TOKEN }} | |
| path: __vm-docs | |
| - name: Import GPG key | |
| uses: crazy-max/ghaction-import-gpg@v6 | |
| id: import-gpg | |
| with: | |
| gpg_private_key: ${{ secrets.VM_BOT_GPG_PRIVATE_KEY }} | |
| passphrase: ${{ secrets.VM_BOT_PASSPHRASE }} | |
| git_user_signingkey: true | |
| git_commit_gpgsign: true | |
| git_config_global: true | |
| # Copies README.md and assets from docs/assets | |
| - name: Update ds docs in VM repo | |
| id: update | |
| run: | | |
| TARGET="../__vm-docs/content/victorialogs-grafana-datasource" | |
| rm -rf ${TARGET} | |
| cp -r docs ${TARGET} | |
| sed -i '/VictoriaLogs datasource for Grafana/g' README.md | |
| cp README.md ${TARGET}/ | |
| sed -i 's|docs/assets/|victorialogs-grafana-datasource/assets/|g' ${TARGET}/README.md | |
| echo "SHORT_SHA=$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_OUTPUT | |
| working-directory: __vl-datasource | |
| - name: Push to vmdocs | |
| run: | | |
| git config --global user.name "${{ steps.import-gpg.outputs.email }}" | |
| git config --global user.email "${{ steps.import-gpg.outputs.email }}" | |
| if [[ -n $(git status --porcelain --untracked-files=no) ]]; then | |
| git add content/victorialogs-grafana-datasource | |
| git commit -S -m "sync docs with VictoriaMetrics/victorialogs-datasource commit: ${{ steps.update.outputs.SHORT_SHA }}" | |
| git push | |
| fi | |
| working-directory: __vm-docs | |
| env: | |
| GH_TOKEN: "${{ secrets.VM_BOT_GH_TOKEN }}" | |
| GITHUB_TOKEN: "${{ secrets.VM_BOT_GH_TOKEN }}" |