Skip to content

Commit 9c807a6

Browse files
authored
Merge pull request #14 from datum-cloud/publish-pages
Add CNAME and simplify GitHub Pages workflow
2 parents e776aca + b712e91 commit 9c807a6

5 files changed

Lines changed: 18 additions & 10614 deletions

File tree

.github/workflows/astro.yml

Lines changed: 14 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,53 @@
1-
# Sample workflow for building and deploying an Astro site to GitHub Pages
2-
#
3-
# To get started with Astro see: https://docs.astro.build/en/getting-started/
4-
#
1+
# Build and deploy Astro site to GitHub Pages
52
name: Deploy Astro site to Pages
63

74
on:
8-
# Runs on pushes targeting the default branch
95
push:
106
branches: ["main"]
11-
12-
# Allows you to run this workflow manually from the Actions tab
137
workflow_dispatch:
148

15-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
169
permissions:
1710
contents: read
1811
pages: write
1912
id-token: write
2013

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

27-
env:
28-
BUILD_PATH: "." # default value when not using subfolders
29-
# BUILD_PATH: subfolder
30-
3118
jobs:
3219
build:
3320
name: Build
3421
runs-on: ubuntu-latest
3522
steps:
3623
- name: Checkout
3724
uses: actions/checkout@v4
38-
- name: Detect package manager
39-
id: detect-package-manager
40-
run: |
41-
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
42-
echo "manager=yarn" >> $GITHUB_OUTPUT
43-
echo "command=install" >> $GITHUB_OUTPUT
44-
echo "runner=yarn" >> $GITHUB_OUTPUT
45-
echo "lockfile=yarn.lock" >> $GITHUB_OUTPUT
46-
exit 0
47-
elif [ -f "${{ github.workspace }}/package.json" ]; then
48-
echo "manager=npm" >> $GITHUB_OUTPUT
49-
echo "command=install" >> $GITHUB_OUTPUT
50-
echo "runner=npm" >> $GITHUB_OUTPUT
51-
echo "lockfile=package-lock.json" >> $GITHUB_OUTPUT
52-
exit 0
53-
else
54-
echo "Unable to determine package manager"
55-
exit 1
56-
fi
57-
- name: Setup Node
58-
uses: actions/setup-node@v4
59-
with:
60-
node-version: "20"
61-
cache: ${{ steps.detect-package-manager.outputs.manager }}
62-
## cache-dependency-path: ${{ env.BUILD_PATH }}/${{ steps.detect-package-manager.outputs.lockfile }}
25+
26+
- name: Setup Bun
27+
uses: oven-sh/setup-bun@v2
28+
6329
- name: Setup Pages
6430
id: pages
6531
uses: actions/configure-pages@v5
32+
6633
- name: Install dependencies
67-
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
68-
working-directory: ${{ env.BUILD_PATH }}
34+
run: bun install
35+
6936
- name: Build with Astro
70-
run: |
71-
${{ steps.detect-package-manager.outputs.runner }} run build
72-
working-directory: ${{ env.BUILD_PATH }}
37+
run: bun run build
38+
7339
- name: Upload artifact
7440
uses: actions/upload-pages-artifact@v3
7541
with:
76-
path: ${{ env.BUILD_PATH }}/dist
42+
path: dist
7743

7844
deploy:
45+
name: Deploy
46+
needs: build
47+
runs-on: ubuntu-latest
7948
environment:
8049
name: github-pages
8150
url: ${{ steps.deployment.outputs.page_url }}
82-
needs: build
83-
runs-on: ubuntu-latest
84-
name: Deploy
8551
steps:
8652
- name: Deploy to GitHub Pages
8753
id: deployment

astro.config.mjs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,12 @@
22
import { defineConfig } from "astro/config";
33
import starlight from "@astrojs/starlight";
44
import tailwindcss from "@tailwindcss/vite";
5-
import node from "@astrojs/node";
65

76
// https://astro.build/config
87
export default defineConfig({
98
site: "https://cloudvalid.com",
109
trailingSlash: "always",
1110
output: 'static',
12-
adapter: node({
13-
mode: "middleware",
14-
}),
1511
integrations: [
1612
starlight({
1713
title: "Docs with Tailwind",
@@ -22,10 +18,6 @@ export default defineConfig({
2218
css: {
2319
devSourcemap: true,
2420
},
25-
ssr: {
26-
noExternal: ['zod'],
27-
},
2821
},
29-
experimental: {},
3022
prefetch: true,
3123
});

0 commit comments

Comments
 (0)