Skip to content

Commit a977387

Browse files
committed
chore: prepare for deploying to GitHub Pages
1 parent ac27ba1 commit a977387

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
# Allows you to run this workflow manually from the Actions tab on GitHub.
7+
workflow_dispatch:
8+
9+
# Allow this job to clone the repo and create a page deployment
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
env:
19+
CPPDOC_SITE: https://cppdoc.cc
20+
steps:
21+
- name: Checkout source code
22+
uses: actions/checkout@v6
23+
- name: Build and upload artifacts
24+
uses: withastro/action@v5
25+
26+
deploy:
27+
needs: build
28+
runs-on: ubuntu-latest
29+
environment:
30+
name: github-pages
31+
url: ${{ steps.deployment.outputs.page_url }}
32+
steps:
33+
- name: Deploy to GitHub Pages
34+
id: deployment
35+
uses: actions/deploy-pages@v4

astro.config.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// @ts-check
2+
import process from "process";
23
import { defineConfig } from "astro/config";
34
import starlight from "@astrojs/starlight";
45
import starlightUtils from "@lorenzo_lewis/starlight-utils";
@@ -7,6 +8,8 @@ import starlightHeadingBadges from "starlight-heading-badges";
78

89
// https://astro.build/config
910
export default defineConfig({
11+
site: process.env.CPPDOC_SITE,
12+
base: process.env.CPPDOC_BASE,
1013
integrations: [
1114
starlight({
1215
title: "CppDoc",

public/CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cppdoc.cc

0 commit comments

Comments
 (0)