1
Fork 0
mirror of https://github.com/RGBCube/chatgpt.v synced 2025-07-27 08:47:44 +00:00
chatgpt.v/.github/workflows/deploy-docs.yml
2023-01-14 13:49:03 +03:00

51 lines
1.4 KiB
YAML

name: Deploy Docs
on: push
env:
project-name: chatgpt
jobs:
deploy-docs:
runs-on: ubuntu-latest
steps:
- name: Set Up V
uses: vlang/setup-v@v1.1
with:
check-latest: true
- name: Checkout Repository
uses: actions/checkout@v3
- name: Checkout Site Repository
uses: actions/checkout@v3
with:
repository: RGBCube/rgbcube.github.io
path: site
- name: Generate Docs
run: |
mv ./src ./${{ env.project-name }}.v # For the docs header
cp ./README.md ./${{ env.project-name }}.v/ # For the README to be included in the docs.
v doc -readme -f html -o ./ -m ./${{ env.project-name }}.v
rm -rf ./site/docs/${{ env.project-name }} || true
mkdir -p ./site/docs/${{ env.project-name }}
cp -r ./_docs/* ./site/docs/${{ env.project-name }}/
- name: Add Private Key To SSH Agent
uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ secrets.RGBCUBE_GITHUB_IO_PRIVATE_KEY }}
- name: Push Docs To GitHub
continue-on-error: true
run: |
cd site
git config user.name "GitHub Actions"
git config user.email "actions@users.noreply.github.com"
git add ./
git commit -m "Deploy ${{ env.project-name }}.v docs"
git push git@github.com:RGBCube/rgbcube.github.io master