Skip to content

Commit dea482b

Browse files
committed
prepare website for deployment via github pages
1 parent 5736ff1 commit dea482b

File tree

5 files changed

+52
-4
lines changed

5 files changed

+52
-4
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
# Trigger the workflow every time you push to the `main` branch
5+
# Using a different branch name? Replace `main` with your branch’s name
6+
push:
7+
branches: [website-deployment]
8+
# Allows you to run this workflow manually from the Actions tab on GitHub.
9+
workflow_dispatch:
10+
11+
# Allow this job to clone the repo and create a page deployment
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout your repository using git
22+
uses: actions/checkout@v5
23+
- name: Install, build, and upload your site
24+
uses: withastro/action@v5
25+
with:
26+
path: ./website # The root location of your Astro project inside the repository. (optional)
27+
# node-version: 24 # The specific version of Node that should be used to build your site. Defaults to 22. (optional)
28+
# 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)
29+
# build-cmd: pnpm run build # The command to run to build your site. Runs the package build script/task by default. (optional)
30+
# env:
31+
# PUBLIC_POKEAPI: 'https://pokeapi.co/api/v2' # Use single quotation marks for the variable value. (optional)
32+
33+
deploy:
34+
needs: build
35+
runs-on: ubuntu-latest
36+
environment:
37+
name: github-pages
38+
url: ${{ steps.deployment.outputs.page_url }}
39+
steps:
40+
- name: Deploy to GitHub Pages
41+
id: deployment
42+
uses: actions/deploy-pages@v4

website/astro.config.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,8 @@ import { defineConfig } from "astro/config";
33
import tailwindcss from "@tailwindcss/vite";
44

55
// https://astro.build/config
6-
export default defineConfig({ vite: { plugins: [tailwindcss()] } });
6+
export default defineConfig({
7+
vite: { plugins: [tailwindcss()] },
8+
site: "https://earth-walker.github.io",
9+
base: "/benefit-decision-toolkit",
10+
});
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<footer class="py-6 text-center flex flex-col gap-3 bg-green-300">
2-
<a href="#top">Return to top</a>
2+
<a href=`${import.meta.env.BASE_URL}/#top`>Return to top</a>
33
<p>Benefit Decision Toolkit</p>
44
<p>With ❤️ from Philly</p>
55
</footer>

website/src/components/Header.astro

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ import logo from "../assets/logos/bdt-logo-large-mono-dark.svg";
1616
{
1717
navLinks.map((link) => (
1818
<li>
19-
<a href={link.path}>{link.title}</a>
19+
<a href={`${import.meta.env.BASE_URL}/${link.path}`}>
20+
{link.title}
21+
</a>
2022
</li>
2123
))
2224
}

website/src/components/Hero.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { Content } from "../assets/copy/Hero.md";
1212
>
1313
<Content />
1414
</div>
15-
<a href="#projects">
15+
<a href=`${import.meta.env.BASE_URL}/#projects`>
1616
<p
1717
class="mt-6 w-fit px-4 py-2 bg-white border-2 border-sky-500 rounded-full text-sky-500 text-lg font-bold font-serif"
1818
>

0 commit comments

Comments
 (0)