deployToGhPages
import { deployToGhPages } from "https://garn.io/ts/v0.0.16/mod.ts";
A garn plugin that allows easy deployment of a package to GitHub pages.
function deployToGhPages<T>(pkg: Package | ((t: T) => Package)): Plugin<{
deployToGhPages: Executable;
}, T>;§
§Parameters
§
- The
Package
whose artifacts will be committed to thegh-pages
branch. For convenience, this can also be a function that takes in a reference to the project and returns thePackage
.
Example:
export const myProject = mkNpmProject({ ... })
.addPackage("genStaticSite", "npm run build && mv dist/* $out")
.add(garn.deployToGhPages(project => project.genStaticSite));
Then running garn run myProject.deployToGhPages
will create the gh-pages
branch for you if it doesn't already exist, and add a commit containing the
artifacts from the specified project (genStaticSite
in the example above)
to the branch.
At this point all you need to do to deploy is push the branch to GitHub with
git push <remote> gh-pages:gh-pages
§Return Type
§
Plugin<{
[src]deployToGhPages: Executable;
}, T>