Setup starlight workflow

This commit is contained in:
Lea Anthony 2024-12-08 12:28:50 +11:00
commit 3d4f61419a
No known key found for this signature in database
GPG key ID: 33DAF7BB90A58405
2 changed files with 62 additions and 20 deletions

View file

@ -1,35 +1,76 @@
name: v3 docs
name: Deploy Starlight Docs
on:
push:
branches:
- v3-alpha
paths:
- 'mkdocs-website/**/*'
- 'docs/**/*'
permissions:
contents: write
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
jobs:
deploy:
build:
runs-on: ubuntu-latest
if: github.event.repository.fork == false
defaults:
run:
working-directory: ./mkdocs-website
working-directory: ./docs # Set working directory to docs
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v3
node-version: 18
cache: 'npm'
# Cache npm dependencies
- name: Cache npm dependencies
uses: actions/cache@v3
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
mkdocs-material-
- run: sudo apt-get install pngquant
- run: pip install pillow cairosvg mkdocs-table-reader-plugin mkdocs-static-i18n
- run: pip install git+https://${GH_TOKEN}@github.com/squidfunk/mkdocs-material-insiders.git
- run: mkdocs build --config-file mkdocs.insiders.yml
- run: mkdocs gh-deploy --force
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
${{ runner.os }}-node-
# Cache Astro build
- name: Cache Astro build
uses: actions/cache@v3
with:
path: |
dist
.astro
key: ${{ runner.os }}-astro-build-${{ hashFiles('src/**/*') }}
restore-keys: |
${{ runner.os }}-astro-build-
- name: Install dependencies
run: npm ci
- name: Build Starlight site
run: npm run build
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: dist
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

1
docs/CNAME Normal file
View file

@ -0,0 +1 @@
v3alpha.wails.io