diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..0be5a9c --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,32 @@ +name: Documentation +on: + push: + branches: [master] + tags: ['*'] + pull_request: + types: [opened, synchronize, reopened] +permissions: + # needed to allow julia-actions/cache to delete old caches that it has created + actions: write + # needed to deploy the documentation + contents: write + statuses: write +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: julia-actions/setup-julia@v3 + with: + version: '1' + - uses: julia-actions/cache@v3 + - name: Install dependencies + shell: julia --color=yes --project=docs {0} + run: | + using Pkg + Pkg.instantiate() + - name: Build and deploy + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} + run: julia --color=yes --project=docs docs/make.jl diff --git a/.gitignore b/.gitignore index b1fb063..7ef58d6 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ *.jl.mem Manifest.toml *.DS_Store +docs/build diff --git a/docs/Project.toml b/docs/Project.toml new file mode 100644 index 0000000..1814eb3 --- /dev/null +++ b/docs/Project.toml @@ -0,0 +1,5 @@ +[deps] +Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" + +[compat] +Documenter = "1" diff --git a/docs/make.jl b/docs/make.jl new file mode 100644 index 0000000..fcd7bad --- /dev/null +++ b/docs/make.jl @@ -0,0 +1,22 @@ +# Copyright (c) 2016: Joey Huchette and contributors +# +# Use of this source code is governed by an MIT-style license that can be found +# in the LICENSE.md file or at https://opensource.org/licenses/MIT. + +using Documenter + +Documenter.makedocs(; + sitename = "PiecewiseLinearOpt.jl", + authors = "Joey Huchette and contributors", + # See https://github.com/JuliaDocs/Documenter.jl/issues/868 + format = Documenter.HTML(; + prettyurls = get(ENV, "CI", nothing) == "true", + assets = String[], + ), + pages = ["Home" => "index.md"], +) + +Documenter.deploydocs(; + repo = "github.com/jump-dev/PiecewiseLinearOpt.jl.git", + push_preview = true, +) diff --git a/docs/src/index.md b/docs/src/index.md new file mode 100644 index 0000000..b3b60c2 --- /dev/null +++ b/docs/src/index.md @@ -0,0 +1 @@ +# PiecewiseLinearOpt.jl