Skip to content

Commit

Permalink
add action to deploy docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Univa committed Nov 25, 2023
1 parent 6a4d55b commit 58d960b
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Deploy docs

on:
push:
branches: [doc-site]
paths:
- "docs/**"
- "rumcake-macros/**"
- "rumcake/**"
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

env:
ASTRO_BUILD_PATH: "./docs"

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "18"
cache: yarn
cache-dependency-path: ${{ env.ASTRO_BUILD_PATH }}/yarn.lock

- name: Install dependencies
run: yarn install --frozen-lockfile
working-directory: ${{ env.ASTRO_BUILD_PATH }}

- name: Build with Astro
run: yarn astro build
working-directory: ${{ env.ASTRO_BUILD_PATH }}

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ${{ env.ASTRO_BUILD_PATH }}/dist

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
1 change: 1 addition & 0 deletions docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import starlight from "@astrojs/starlight";

// https://astro.build/config
export default defineConfig({
site: "https://univa.github.io",
base: "/rumcake",
trailingSlash: "always",
build: {
Expand Down

0 comments on commit 58d960b

Please sign in to comment.