docs: revise repo README #53
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/victorialogs/victorialogs-datasource/ | |
| steps: | |
| - name: Checkout datasource repo | |
| uses: actions/checkout@v4 | |
| with: | |
| path: __vl-datasource | |
| - name: Checkout docs 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 | |
| - name: Update datasource docs in docs repo | |
| id: update | |
| run: | | |
| export TARGET="../__vm-docs/content/victorialogs-grafana-datasource" | |
| rm -rf ${TARGET} | |
| cp -r docs ${TARGET} | |
| cp README.md ${TARGET}/ | |
| sed -i '/VictoriaLogs datasource for Grafana/g' ${TARGET}/README.md | |
| sed -i 's|docs/assets/|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 docs repo | |
| 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) ]]; 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 }}" |