Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Deploy Log4brains demo site to GitHub Pages

on:
push:
branches: [develop]
paths:
- ".log4brains.yml"
- "docs/adr/**"
- "packages/core/docs/adr/**"
- "packages/web/docs/adr/**"
- "packages/**"
- "package.json"
- "yarn.lock"
- ".github/workflows/pages.yml"
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: yarn
cache-dependency-path: yarn.lock

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build packages
run: yarn build

- name: Generate demo site
run: |
npx log4brains build --basePath "/${GITHUB_REPOSITORY#*/}"
touch .log4brains/out/.nojekyll

- name: Configure Pages
uses: actions/configure-pages@v5

- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: .log4brains/out

deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
steps:
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4