PublishGithubPages
Module: AutodocsPublish
Methods
init
()
Initialisation step for Github Pages
Used to check/ set any Github Pages environment variables
outputUrls
()
Outputs the base URL and the API URL at which the documentation should be published.
Uses CNAME
file based on best guess,
otherwise defaults to *.github/*
run
()
Performs the required steps for publishing to Github pages
- runs
npm run generatedocs
git fetch
es thegh-pages
branch of the project into a throwaway git repository- copies the documentation generated by the
generatedocs
script into thegh-pages
branch - copies any additional files required into the gh-pages branch
- if any files have changed,
git commit
sgit push
es on thegh-pages
branch- this is when the files actually succeed in publishing
- if necessary, cleans up the throwaway git repository
Properties
GH_REPO
String (Environment Variable)
Default: Second half of `REPO_SLUG`
GH_TOKEN
String (Environment Variable)
Default: None - throws when not set
GH_USER
String (Environment Variable)
Default: First half of `REPO_SLUG`
REPO_SLUG
String (Environment Variable)
Default: None - throws when not set