Skip to content

Commit

Permalink
docs: sync docs to vmdocs directly
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewChubatiuk committed Feb 11, 2025
1 parent 96519dc commit 8577e88
Showing 1 changed file with 23 additions and 26 deletions.
49 changes: 23 additions & 26 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,18 @@ jobs:
name: docs
url: https://docs.victoriametrics.com/
steps:
- name: Check out operator code
- name: Checkout operator repo
uses: actions/checkout@v4
with:
repository: VictoriaMetrics/operator
ref: master
token: ${{ secrets.VM_BOT_GH_TOKEN }}
path: __vm-operator-repo
path: __vm-operator

- name: Check out VM code
- name: Checkout docs repo
uses: actions/checkout@v4
with:
repository: VictoriaMetrics/VictoriaMetrics
ref: master
repository: VictoriaMetrics/vmdocs
ref: main
token: ${{ secrets.VM_BOT_GH_TOKEN }}
path: __vm-docs-repo
path: __vm-docs

- name: Setup Go
uses: actions/setup-go@v5
Expand All @@ -44,9 +41,9 @@ jobs:
passphrase: ${{ secrets.VM_BOT_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
workdir: __vm-docs-repo
git_config_global: true

- name: Update operator docs in VM repo
- name: Copy docs
id: update
run: |
make docs
Expand All @@ -56,20 +53,20 @@ jobs:
--include="*.webp" \
--include="*.md" \
--exclude="*" \
docs/ ../__vm-docs-repo/docs/operator/
echo "BUILDTIME=$(date +%s)" >> $GITHUB_OUTPUT
docs/ ../__vm-docs/content/operator/
echo "SHORT_SHA=$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_OUTPUT
working-directory: __vm-operator-repo
working-directory: __vm-operator

- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
add-paths: docs/operator
commit-message: Automatic update operator docs from ${{ github.repository }}@${{ steps.update.outputs.SHORT_SHA }}
signoff: true
committer: "Github Actions <${{ steps.import-gpg.outputs.email }}>"
path: __vm-docs-repo
branch: operator-docs-update-${{ steps.update.outputs.BUILDTIME }}
token: ${{ secrets.VM_BOT_GH_TOKEN }}
delete-branch: true
title: Automatic update operator docs from ${{ github.repository }}@${{ steps.update.outputs.SHORT_SHA }}
- 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/helm
git commit -S -m "sync docs with VictoriaMetrics/operator 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 }}"

0 comments on commit 8577e88

Please sign in to comment.