Skip to content

Commit

Permalink
ci(docs): publish to GitHub pages
Browse files Browse the repository at this point in the history
  • Loading branch information
mfal committed Jan 26, 2024
1 parent b4c4e80 commit 8f5f20e
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Publish docs
on:
push:
branches:
- feature/first-docs

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version: 20
cache: "yarn"
registry-url: "https://registry.npmjs.org"

- run: yarn install --immutable
- uses: nrwl/nx-set-shas@v4
- if: github.ref != 'refs/heads/main'
run: git branch --track main origin/main
- run: yarn nx affected -t build --parallel=3

- uses: actions/configure-pages@v4
with:
static_site_generator: next

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: packages/docs/out

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
needs: build

steps:
- name: Publish to GitHub Pages 🚀
id: deployment
uses: actions/deploy-pages@v4
1 change: 1 addition & 0 deletions packages/docs/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import remarkMdxFrontmatter from "remark-mdx-frontmatter";

/** @type {import("next").NextConfig} */
const nextConfig = {
output: "export",
pageExtensions: ["js", "jsx", "mdx", "ts", "tsx", "example"],
webpack: (config, _) => {
config.module.rules.push({
Expand Down

0 comments on commit 8f5f20e

Please sign in to comment.