Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • 463e2d6
  • /
  • man
  • /
  • deploy_site_github.Rd
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge
swh:1:cnt:5fd614f1caee7d092d874aea04c784e20e6ef041
directory badge
swh:1:dir:9598e1a76c12cbb6ba86c048169cee9324c35cc7

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
deploy_site_github.Rd
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/deploy-site.R
\name{deploy_site_github}
\alias{deploy_site_github}
\title{Deploy a pkgdown site on Travis-CI to Github Pages}
\usage{
deploy_site_github(
  pkg = ".",
  install = TRUE,
  tarball = Sys.getenv("PKG_TARBALL", ""),
  ssh_id = Sys.getenv("id_rsa", ""),
  commit_message = construct_commit_message(pkg),
  verbose = FALSE,
  ...,
  repo_slug = "DEPRECATED"
)
}
\arguments{
\item{pkg}{Path to package.}

\item{install}{Optionally, opt-out of automatic installation. This is
necessary if the package you're documenting is a dependency of pkgdown}

\item{tarball}{The location of the built package tarball. The default Travis
configuration for R packages sets \code{PKG_TARBALL} to this path.}

\item{ssh_id}{The private id to use, a base64 encoded content of the private
pem file. This should \emph{not} be your personal private key. Instead create a
new keypair specifically for deploying the site. The easiest way is to use
\code{travis::use_travis_deploy()}.}

\item{commit_message}{The commit message to be used for the commit.}

\item{verbose}{Print verbose output}

\item{...}{Additional arguments passed to \code{\link[=build_site]{build_site()}}.}

\item{repo_slug}{\strong{Deprecated} No longer used.}
}
\description{
\code{deploy_site_github()} sets up your SSH keys for deployment, builds the
site with \code{\link[=build_site]{build_site()}}, commits the site to the \code{gh-pages} branch and then pushes
the results back to GitHub. \code{deploy_site_github()} is meant only to be used
by the CI system on Travis, it should not be called locally.
\code{\link[=deploy_to_branch]{deploy_to_branch()}} can be used to deploy a site directly to GitHub Pages
locally. See 'Setup' for details on setting up your repository to use this.
}
\section{Setup}{

For a quick setup, you can use \code{\link[usethis:use_pkgdown_travis]{usethis::use_pkgdown_travis()}}. It  will help you
with the following detailed steps.
\itemize{
\item Add the following to your \code{.travis.yml} file.\preformatted{before_cache: Rscript -e 'remotes::install_cran("pkgdown")'
deploy:
  provider: script
  script: Rscript -e 'pkgdown::deploy_site_github()'
  skip_cleanup: true
}
\item Then you will need to setup your deployment keys. The easiest way is to call
\code{travis::use_travis_deploy()}. This will generate and push the necessary
keys to your GitHub and Travis accounts. See the \href{https://docs.ropensci.org/travis/index.html}{travis package website} for more details.
\item Next, make sure that a gh-pages branch exists. The simplest way to do
so is to run the following git commands locally:\preformatted{git checkout --orphan gh-pages
git rm -rf .
git commit --allow-empty -m 'Initial gh-pages commit'
git push origin gh-pages
git checkout master
}

We recommend doing this outside of RStudio (with the project closed) as
from RStudio's perspective you end up deleting all the files and then
re-creating them.
\item If you're using a custom CNAME, make sure you have set the \code{url} in
\verb{_pkgdown.yaml}:\if{html}{\out{<div class="yaml">}}\preformatted{url: http://pkgdown.r-lib.org
}\if{html}{\out{</div>}}
}
}

back to top

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API