This repository collects CI tooling for the SUSE documentation team.
Tooling on this branch and the other gha-
branches is for GitHub Actions.
This repository makes extensive use of orphan branches, because each branch does completely disparate things.
Name | Content | Description |
---|---|---|
gha-workflow-example |
example workflow file | An example workflow file to validate, build, and publish documentation with DAPS. (You are here.) |
gha-select-dcs |
action | An action that allows checking basic DC file properties and making lists of which DC files to validate and build from. Action-specific readme |
gha-validate |
action | An action that validates DC files with DAPS. Action-specific readme |
gha-build |
action | An action that builds HTML and single-HTML from DC files with DAPS. Action-specific readme |
gha-publish |
action | An action that publish artifacts into a Git repository. Action-specific readme |
Name | Description |
---|---|
travis-obsolete |
Travis CI script and container build description (deprecated) |
All containers used by current versions of our tooling come from https://build.opensuse.org/project/show/Documentation:Containers. They can be downloaded from https://registry.opensuse.org.
opensuse-daps-toolchain
: Main (large) toolchain container used forgha-build
.opensuse-daps-toolchain-mini
: Smaller toolchain container used forgha-select-dcs
andgha-validate
.opensuse-git-ssh
: Very basic Git/SSH container used forgha-publish
.
All of the above containers are currently based on openSUSE Leap 15.3.
Copy the file docbook.yml
from this repository into the path .github/workflows/
of your documentation repository.
Delete the line with build-html:
and all lines after it.
For official SUSE repositories, all actions below that involve the GitHub web interface should be performed as @suse-docs-bot. This avoids creating automated pushes under your own GitHub account name, which may confuse people. @suse-docs-bot only needs access to the repo when you upload the key and should be removed from contributor list of the source repo immediately after that. If you do not have access to the @suse-docs-bot account, ask @fsundermeyer, @tomschr, or @taroth21 to perform the below actions for you.
-
To allow for builds to be uploaded into a publishing Git repository, create an SSH key pair that can be used as a deploy key. We use an internal repository to hold the SSH deploy keys to make sure they are not lost.
a. Clone the internal
doc-ci-secrets
repository.b. Create a new directory named after your repository in
doc-ci-secrets/ci-ssh-docs-bot
(if you are using the @suse-docs-bot user account; otherwise use the directoryci-ssh
).c. Generate a key pair in within this directory. Do not set a password for the key file.
ssh-keygen -t rsa -b 4096 -C "[email protected]" -f id_rsa
d. Commit/push both key files,
id_rsa
andid_rsa.pub
. -
Create a new target repository for publishing within the organization https://github.com/susedoc. Ideally, the name of the target repository should match the name of the source repository.
-
Clone the target repository locally, create a
gh-pages
branch in it and create an initial commit:git clone [email protected]:SUSEdoc/doc-repo doc-repo-publish && doc-repo-publish git checkout -b gh-pages git commit --allow-empty -m"Initial Commit" git push origin gh-pages
-
Add the
id_rsa.pub
public key as a deploy key for the target repository. Open the repository's page on GitHub, then click Settings > Deploy keys. Click Add deploy key, then copy the text content ofid_rsa.pub
. Make sure to enable Allow write access. -
Within the source repository, set up the
id_rsa
private key as a GitHub Actions secret. Open the repository's page on GitHub, then click Settings > Secrets > Actions. Click New repository secret, then copy the text content ofid_rsa
. Give it a name such asDEPLOY_KEY_
and the name of the repository. (Names of secrets must only include underscores and capital letters.) -
Copy the file
docbook.yml
from this repository into the path.github/workflows/
of your documentation repository. Update the valueDEPLOY_KEY: ${{ secrets.DEPLOY_KEY_SLE }}
with the name that you gave your deploy key in the previous step. Update the value oforiginal-org: SUSE
with the name of the home org of your repository (which may very well beSUSE
too).