Skip to content

Commit 12b6dbe

Browse files
committed
Adds a static pages deploy action
1 parent e9f0258 commit 12b6dbe

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Deploy static content to Pages
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
workflow_dispatch:
7+
8+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
15+
concurrency:
16+
group: "pages"
17+
cancel-in-progress: false
18+
19+
jobs:
20+
deploy:
21+
environment:
22+
name: github-pages
23+
url: ${{ steps.deployment.outputs.page_url }}
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
29+
- name: Setup Pages
30+
uses: actions/configure-pages@v5
31+
32+
- uses: pnpm/action-setup@v2.2.4
33+
with:
34+
version: 9.4.0
35+
run_install: true
36+
37+
- name: Build package
38+
run: pnpm build
39+
40+
- name: Build Ladle static content
41+
run: pnpm ladle build
42+
env:
43+
BASE_URL: ${{ github.event.repository.name }}
44+
45+
- name: Upload artifact
46+
uses: actions/upload-pages-artifact@v3
47+
with:
48+
path: "build"
49+
50+
- name: Deploy to GitHub Pages
51+
id: deployment
52+
uses: actions/deploy-pages@v4

.ladle/config.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
const baseUrl = process.env["BASE_URL"] || "/"
2+
13
export default {
24
stories: ["{src,.ladle}/**/*.stories.{js,jsx,ts,tsx}"],
5+
base: baseUrl,
36
addons: {
47
ladle: {
58
enabled: false,

0 commit comments

Comments
 (0)