Deploying Documentation to GitHub Pages

30 minutes
  • 2 Learning Objectives

About this Hands-on Lab

Your company has developed a mobile application. The GitHub README has developer notes, but users report they are not helpful for troubleshooting common user issues. Marketing has worked with the Engineering team to create a user guide Markdown document. This will be updated with every release. You need to develop a GitHub Actions workflow to deploy this user guide to GitHub Pages so users can access the latest user guide with each release.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Set Up Documentation to Deploy as Part of the Workflow
  1. Fork this repo: https://github.com/linuxacademy/content-github-actions-deep-dive-lesson. Check out the lab branch.

  2. You can clone the repo locally or use the GitHub interface. Check the /.github/workflows/pipeline.yaml file. The workflow contains jobs to run a linter and build an artifact. Create a docs directory and a userguide.md file at the root directory. Add some text to the file and save it.

  3. Add a job to the workflow to deploy the user guide file to GitHub Pages. This is an instance where a Community Action might save some time. Check the Pages URL to confirm the Markdown has been converted to html and published.

Set Up a Trigger Condition for the Workflow
  1. The docs are deploying with the pipeline, but the file hasn’t been updated in the last few commits, leading to the docs still being out of date. Add a condition so the workflow doesn’t run unless the user guide has been changed — that way, new code won’t build without supporting documentation.

  2. Update the user guide and push the changes to validate that the new changes have deployed.

  3. Update the code file without changing the user guide and push those changes. Verify that the workflow doesn’t run without updates to the docs.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?