Skip to content

Commit

Permalink
deploy to github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
haarg committed Oct 24, 2024
1 parent fc95a89 commit a8c9e9e
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 4 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Docs

on:
push:

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- uses: actions/configure-pages@v3
id: pages
- name: Install dependencies
run: npm install
- name: Build
env:
GITHUB_PAGES_BASE: "${{ steps.pages.outputs.base_url }}"
run: npm run docs:build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: .vuepress/dist/

deploy:
if: github.ref == 'refs/heads/master'
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
concurrency:
group: deploy
cancel-in-progress: true
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
12 changes: 8 additions & 4 deletions .vuepress/config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { viteBundler } from '@vuepress/bundler-vite'
import { defaultTheme } from '@vuepress/theme-default'
import { defineUserConfig } from 'vuepress'
import { env } from 'node:process';

export default defineUserConfig({
const options = {
title: "MetaCPAN infra",
description: "MetaCPAN infrastructure and networking",
bundler: viteBundler(),
Expand Down Expand Up @@ -32,7 +33,10 @@ export default defineUserConfig({
// }
// ]
]
})

export {
};

if (env.GITHUB_PAGES_BASE) {
options.base = env.GITHUB_PAGES_BASE.replace(/^\/?/, '/').replace(/\/?$/, '/');
}

export default defineUserConfig(options);

0 comments on commit a8c9e9e

Please sign in to comment.