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

Use Vitepress to deploy #32

Merged
merged 1 commit into from
Mar 24, 2024
Merged
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
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"
24 changes: 19 additions & 5 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
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"
),
pages=[
"Home" => "index.md",
"API Reference" => "api.md",
Expand All @@ -14,6 +22,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
Loading