Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from my infrastructure to GitHub Pages #42

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# https://docs.astro.build/en/guides/deploy/github/
name: Deploy to GitHub Pages

on:
push:
branches: [main]
workflow_dispatch:

# Allow this job to clone the repo and create a page deployment
permissions:
contents: read
pages: write
id-token: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout your repository using git
uses: actions/checkout@v4
- name: Install, build, and upload your site
uses: withastro/action@v3
# with:
# path: . # The root location of your Astro project inside the repository. (optional)
# node-version: 20 # The specific version of Node that should be used to build your site. Defaults to 20. (optional)
# 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)

deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ For now, this repo is collecting and structuring the documentation required for

See [`src/content/docs/index.md`](./index) for a proposed vague structure and entrypoint.

Edit the content in Markdown files in `/src/content/docs` manually, or by going to `/keystatic` on the [live site](kiara-website.pages.dev/keystatic) and using the CMS.
Edit the content in Markdown files in `/src/content/docs` manually.

All files need to have a `title` key in the markdown frontmatter. This means the very start of the file needs to look like this:

Expand All @@ -16,7 +16,7 @@ title: Your title here
---
```

The CMS will do this automatically, if you create a file by hand you'll need to add it. If you forget, the build will fail.
When you create a new file by hand you'll need to add it. If you forget, the build will fail.

## Disclaimer

Expand Down
19 changes: 9 additions & 10 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import { defineConfig } from "astro/config";
import starlight from "@astrojs/starlight";
import react from "@astrojs/react";
import markdoc from "@astrojs/markdoc";
import keystatic from "@keystatic/astro";
import cloudflare from "@astrojs/cloudflare";
import { readdirSync } from "fs";
import svelte from "@astrojs/svelte";
import semverSort from "semver-sort";
import starlightLinksValidator from "starlight-links-validator";

function getOperations() {
const plugins = readdirSync("src/content/plugins");
Expand Down Expand Up @@ -49,17 +46,23 @@ function getOperations() {
}
// https://astro.build/config
export default defineConfig({
// https://docs.astro.build/en/guides/deploy/github/#deploying-to-a-githubio-url
site: "https://DHARPA-Project.github.io",
base: "/kiara-website",
integrations: [
starlight({
plugins: [starlightLinksValidator()],

title: "kiara",
editLink: {
baseUrl: "https://github.com/DHARPA-project/kiara-website/edit/main/",
},
customCss: ["./src/styles/custom.css"],
components: {
// override the default title component, to add in last modified time
PageTitle: './src/components/Title.astro',
PageTitle: "./src/components/Title.astro",
},
expressiveCode: { themes: ["catppuccin-macchiato", "catppuccin-latte"] },
social: {
github: "https://github.com/DHARPA-project/kiara-website",
},
Expand Down Expand Up @@ -111,11 +114,7 @@ export default defineConfig({
},
],
}),
react(),
markdoc({ allowHTML: true }),
keystatic(),
svelte(),
],
output: "hybrid",
adapter: cloudflare(),
output: "static",
});
112 changes: 0 additions & 112 deletions keystatic.config.ts

This file was deleted.

11 changes: 0 additions & 11 deletions markdoc.config.mjs

This file was deleted.

Loading