5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-10 22:19:46 +08:00

Setup starlight workflow

This commit is contained in:
Lea Anthony 2024-12-08 12:37:13 +11:00
parent db06fcd087
commit fef7b0827b
No known key found for this signature in database
GPG Key ID: 33DAF7BB90A58405

View File

@ -1,69 +1,32 @@
name: Deploy Starlight Docs
on:
push:
branches:
- v3-alpha
paths:
- 'docs/**/*'
name: Deploy to GitHub Pages
on:
# Trigger the workflow every time you push to the `main` branch
# Using a different branch name? Replace `main` with your branchs name
push:
branches: [main]
# Allows you to run this workflow manually from the Actions tab on GitHub.
workflow_dispatch:
# Allow this job to clone the repo and create a page deployment
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
if: github.event.repository.fork == false
defaults:
run:
working-directory: ./docs # Set working directory to docs
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
- name: Checkout your repository using git
uses: actions/checkout@v4
- name: Install, build, and upload your site output
uses: withastro/action@v2
with:
node-version: 18
cache: 'npm'
cache-dependency-path: docs/package-lock.json
# Cache npm dependencies
- name: Cache npm dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ 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
path: docs
node-version: 20 # The specific version of Node that should be used to build your site. Defaults to 18. (optional)
# package-manager: pnpm@latest # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional)
deploy:
needs: build
@ -74,4 +37,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v4