mirror of
https://github.com/thomiceli/opengist.git
synced 2026-06-23 04:10:18 +00:00
b43789943a
Signed-off-by: Thomas Miceli <tho.miceli@gmail.com>
42 lines
1.1 KiB
YAML
42 lines
1.1 KiB
YAML
name: Build / Deploy docs
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: '26'
|
|
|
|
- name: Install dependencies
|
|
run: npm install
|
|
working-directory: docs
|
|
|
|
- name: Build docs
|
|
run: npm run build
|
|
working-directory: docs
|
|
|
|
- name: Push to docs repository
|
|
run: |
|
|
git clone https://${{ secrets.STATIC_REPO_TOKEN }}@github.com/${{ secrets.STATIC_REPO }}.git target-repo
|
|
rm -rf target-repo/srv/opengist
|
|
mkdir -p target-repo/srv/opengist
|
|
cp -r docs/.vitepress/dist/* target-repo/srv/opengist/
|
|
cd target-repo
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
git add .
|
|
git commit -m "Deploy docs from ${{ github.repository }}@${{ github.sha }}" || echo "No changes to commit"
|
|
git pull --rebase
|
|
git push
|