generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 14
/
action.yml
66 lines (59 loc) · 2.32 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: 'Deploy package documentation'
description: 'Build and deploy the documentation for a Julia package.'
author: 'David Anthoff'
branding:
icon: 'upload'
color: 'gray-dark'
inputs:
prefix:
description: 'Value inserted in front of the julia command, e.g. for running xvfb-run julia [...]'
default: ''
required: false
install-package:
description: 'Whether or not to install the package with `Pkg.develop` into the `docs` environment'
default: true
required: false
project:
description: 'Directory that contains the folder `docs` to deploy from'
default: '.'
required: false
runs:
using: 'composite'
steps:
- name: Install GitHubActions.jl in its own (shared) environment
run: |
using Pkg
Pkg.activate("docs-logger-env"; shared=true)
Pkg.add(Pkg.PackageSpec(name="GitHubActions", version="0.1"))
shell: julia --color=yes {0}
working-directory: ${{inputs.project}}
- name: Install the current package into the `docs` environment
run: |
# The Julia command that will be executed
julia_cmd=( julia --color=yes --code-coverage --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' )
# Add the prefix in front of the command if there is one
prefix=( ${{ inputs.prefix }} )
[[ ${#prefix[@]} -gt 0 ]] && julia_cmd=( "${prefix[@]}" "${julia_cmd[@]}" )
# Run the Julia command
"${julia_cmd[@]}"
shell: bash
working-directory: ${{inputs.project}}
if: ${{ inputs.install-package == 'true'}}
- name: Build the documentation
run: |
# The Julia command that will be executed
julia_cmd=( julia --color=yes --project=docs/ -e '
@eval Module() begin
push!(LOAD_PATH, "@docs-logger-env") # access GitHubActions.jl
import Logging, GitHubActions
Logging.global_logger(GitHubActions.GitHubActionsLogger())
pop!(LOAD_PATH)
end
include("docs/make.jl")' )
# Add the prefix in front of the command if there is one
prefix="${{ inputs.prefix }}"
[[ -n $prefix ]] && julia_cmd=( "$prefix" "${julia_cmd[@]}" )
# Run the Julia command
"${julia_cmd[@]}"
shell: bash
working-directory: ${{inputs.project}}