Skip to content

Commit

Permalink
Setup Documenter on CI (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
tkf authored Mar 20, 2022
1 parent ac7e81b commit ddbd30e
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Documentation

on:
push:
branches:
- main
- actions/trigger/docs
tags: '*'
pull_request:

jobs:
Documenter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@latest
with:
version: 1.7
- name: Install Run.jl
run: julia -e 'using Pkg; pkg"add [email protected]"'
- name: Install dependencies
run: docs/instantiate.jl
- name: Build and deploy
id: build-and-deploy
if: |
github.event_name == 'push' || (
github.event_name == 'pull_request' &&
!contains(github.head_ref, 'create-pull-request/')
)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.SSH_KEY }}
run: julia -e 'using Run; Run.docs()'
- name: Just build
if: steps.build-and-deploy.outcome == 'skipped'
run: julia -e 'using Run; Run.docs()'
2 changes: 2 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
Try = "bf1d0ff0-c4a9-496b-85f0-2b0d71c4f32a"
TryExperimental = "ae3b139e-64da-4858-8f55-5617df0d650e"
27 changes: 27 additions & 0 deletions docs/instantiate.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
# -*- mode: julia -*-
#=
JULIA="${JULIA:-julia}"
HERE="$(dirname "${BASH_SOURCE[0]}")"
JULIA_CMD="${JULIA_CMD:-$JULIA --color=yes --startup-file=no --project="$HERE"}"
export JULIA_LOAD_PATH=@:@stdlib # exclude default environment
exec $JULIA_CMD "${BASH_SOURCE[0]}" "$@"
=#

using Pkg

Pkg.develop([
PackageSpec(
name = "Try",
path = dirname(@__DIR__),
# url = "https://github.com/tkf/Try.jl.git",
),
PackageSpec(
name = "TryExperimental",
path = dirname(@__DIR__),
# url = "https://github.com/tkf/Try.jl.git",
subdir = "lib/TryExperimental",
),
])

Pkg.instantiate()

0 comments on commit ddbd30e

Please sign in to comment.