From a58ec9ba4f43a2a8e7c0ce350ad1dd29074511f9 Mon Sep 17 00:00:00 2001 From: Artem Navoiev Date: Thu, 13 Jul 2023 23:52:52 +0200 Subject: [PATCH] add job to sync the docs Signed-off-by: Artem Navoiev --- .github/workflows/sync-docs.yml | 48 +++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/sync-docs.yml diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml new file mode 100644 index 000000000..5aacd4314 --- /dev/null +++ b/.github/workflows/sync-docs.yml @@ -0,0 +1,48 @@ +name: publish-docs +on: + push: + branches: + - 'master' + - 'sync-docs' + workflow_dispatch: {} +permissions: + contents: read # This is required for actions/checkout and to commit back image update + deployments: write +jobs: + build: + environment: + name: docs + url: https://docsnew.victoriametrics.com/ + name: Build + runs-on: ubuntu-latest + steps: + - name: Code checkout + uses: actions/checkout@v3 + with: + path: main + - name: Checkout private code + uses: actions/checkout@v3 + with: + repository: VictoriaMetrics/vmdocs + token: ${{ secrets.VM_BOT_GH_TOKEN }} + path: docs + + - name: Import GPG key + uses: crazy-max/ghaction-import-gpg@v5 + with: + gpg_private_key: ${{ secrets.VM_BOT_GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.VM_BOT_PASSPHRASE }} + git_user_signingkey: true + git_commit_gpgsign: true + + - name: update code and commit + run: | + rm -rf content + cp -r /main/docs content + make clean-after-copy + git config --global user.name "${{ steps.import-gpg.outputs.email }}" + git config --global user.email "${{ steps.import-gpg.outputs.email }}" + git add . + git commit -S -m "sync docs with VictoriaMetrics/VictoriaMetrics" + git push + working-directory: docs \ No newline at end of file