Skip to content

Commit

Permalink
Use Vitepress to deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Mar 24, 2024
1 parent 61d8b5e commit 89392de
Show file tree
Hide file tree
Showing 11 changed files with 3,173 additions and 22 deletions.
7 changes: 7 additions & 0 deletions .github/depandabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
55 changes: 43 additions & 12 deletions .github/workflows/Documentation.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,57 @@
name: Documentation
name: Documenter

on:
# Runs on pushes targeting the `master` branch. Change this to `main` if you're
# using the `main` branch as the default branch.
push:
branches:
- main
tags: ["*"]
pull_request:
branches:
- main

# 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: write
pages: write
id-token: write
statuses: 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:
# Build job
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@latest
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node # This is still useful because it caches the node_modules so we don't constantly re-install. You don't technically need this, though.
uses: actions/setup-node@v3
with:
version: "1"
- name: Install dependencies
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Build and deploy
run: julia --project=docs/ docs/make.jl
node-version: 20
cache: npm # or pnpm / yarn
cache-dependency-path: "docs/package-lock.json" # this should be a package-lock.json file
- name: Setup Julia
uses: julia-actions/setup-julia@v1
- name: Pull Julia cache
uses: julia-actions/cache@v1
- name: Install documentation dependencies
run: julia --project=docs -e 'using Pkg; pkg"dev ."; Pkg.instantiate(); Pkg.precompile(); Pkg.status()'
- name: Instantiate NPM
run: cd docs/; npm i; cd ..
#- name: Creating new mds from src
- name: Build and deploy docs
uses: julia-actions/julia-docdeploy@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # If authenticating with SSH deploy key
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key
GKSwstype: "100" # for Plots.jl plots (if you have them)
JULIA_DEBUG: "Documenter"
DATADEPS_ALWAYS_ACCEPT: true
4 changes: 4 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
build/
node_modules/
package-lock.json
Manifest.toml
4 changes: 1 addition & 3 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterVitepress = "4710194d-e776-4893-9690-8d956a29c365"
Wandb = "ad70616a-06c9-5745-b1f1-6a5f42545108"

[compat]
Documenter = "1"
25 changes: 20 additions & 5 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
using Documenter, Wandb
using Documenter, DocumenterVitepress
using Wandb

makedocs(; sitename="Wandb", authors="Avik Pal",
format=Documenter.HTML(; prettyurls=get(ENV, "CI", nothing) == "true"),
makedocs(;
modules=[Wandb],
authors="Avik Pal",
repo="https://github.com/avik-pal/Wandb.jl",
sitename="Wandb.jl Documentation",
format=DocumenterVitepress.MarkdownVitepress(;
repo="github.com/avik-pal/Wandb.jl",
devurl="dev",
devbranch="main",
deploy_url="https://avik-pal.github.io/Wandb.jl"
),
pages=[
"Home" => "index.md",
"API Reference" => "api.md",
Expand All @@ -14,6 +23,12 @@ makedocs(; sitename="Wandb", authors="Avik Pal",
"Artifacts API" => "examples/artifacts.md",
"MPI.jl Integration" => "examples/mpi.md"
]
])
]
)

deploydocs(; repo="github.com/avik-pal/Wandb.jl.git", push_preview=true, devbranch="main")
deploydocs(;
repo="github.com/avik-pal/Wandb.jl",
target="build",
push_preview=true,
devbranch="main"
)
Loading

0 comments on commit 89392de

Please sign in to comment.