Skip to content

Commit 9ca4fb2

Browse files
committed
chore: add GitHub Actions workflow for deploying Astro site to GitHub Pages and update site configuration
1 parent 1df674c commit 9ca4fb2

2 files changed

Lines changed: 34 additions & 1 deletion

File tree

.github/workflows/deploy.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Deploy Astro to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [ main ] # or your default branch
6+
workflow_dispatch: # allow manual runs
7+
8+
permissions:
9+
contents: read # for checkout
10+
pages: write # to publish
11+
id-token: write # for OIDC
12+
13+
jobs:
14+
build-and-deploy:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
# 1. Fetch your code
19+
- name: Checkout repository
20+
uses: actions/checkout@v4 # :contentReference[oaicite:1]{index=1}
21+
22+
# 2. Build & stage your Astro site
23+
- name: Build Astro site
24+
uses: withastro/action@v4 # :contentReference[oaicite:2]{index=2}
25+
# no 'with' block needed unless your Astro project lives in a subfolder
26+
27+
# 3. Publish to GitHub Pages
28+
- name: Deploy to GitHub Pages
29+
id: deployment
30+
uses: actions/deploy-pages@v2 # :contentReference[oaicite:3]{index=3}
31+

astro.config.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import sitemap from '@astrojs/sitemap';
55

66
// https://astro.build/config
77
export default defineConfig({
8-
site: 'https://example.com',
8+
site: 'https://mag1cfrog.github.io',
9+
base: '/spark-tuning-notes/',
10+
output: 'static',
911
integrations: [mdx(), sitemap()],
1012
});

0 commit comments

Comments
 (0)