Skip to content

Commit

Permalink
Adding deploy docs action
Browse files Browse the repository at this point in the history
  • Loading branch information
kolloch committed Jan 2, 2024
1 parent de57dc8 commit b2e01eb
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 10 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v12
with:
name: eigenvalue
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
- run: 'nix build .#docs'
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'result'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
2 changes: 0 additions & 2 deletions docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,3 @@ pnpm-debug.log*

# macOS-specific files
.DS_Store

docs
17 changes: 9 additions & 8 deletions docs/flake-module.nix
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
{self, ...}: {
perSystem = { config, self', inputs', pkgs, system, ... }: {
packages.docs = pkgs.buildNpmPackage {
pname = "docs";
version = "0.1.0";

src = pkgs.nix-gitignore.gitignoreSource [
".vscode"
"README.md"
".gitignore"
"nix"
"flake.*"
]
src =
pkgs.nix-gitignore.gitignoreSource [
".vscode"
"README.md"
".gitignore"
"nix"
"flake.*"
]
./.;

buildInputs = [
Expand Down
13 changes: 13 additions & 0 deletions docs/src/content/docs/guides/example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: Example Guide
description: A guide in my new Starlight docs site.
---

TODO

Guides lead a user through a specific task they want to accomplish, often with a sequence of steps.
Writing a good guide requires thinking about what your users are trying to do.

## Further reading

- Read [about how-to guides](https://diataxis.fr/how-to-guides/) in the Diátaxis framework
17 changes: 17 additions & 0 deletions docs/src/content/docs/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: Welcome to crate2nix
description: What is crate2nix?
template: splash
hero:
tagline: This is the WIP new crate2nix page.
actions:
- text: Example Guide
link: /guides/example/
icon: right-arrow
variant: primary
- text: Read the Starlight docs
link: https://starlight.astro.build
icon: external
---

import { Card, CardGrid } from '@astrojs/starlight/components';
13 changes: 13 additions & 0 deletions docs/src/content/docs/reference/example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: Example Reference
description: A reference page in my new Starlight docs site.
---

TODO

Reference pages are ideal for outlining how things work in terse and clear terms.
Less concerned with telling a story or addressing a specific use case, they should give a comprehensive outline of what your documenting.

## Further reading

- Read [about reference](https://diataxis.fr/reference/) in the Diátaxis framework

0 comments on commit b2e01eb

Please sign in to comment.