Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Rowena Foo committed Oct 12, 2021
0 parents commit dad29ab
Show file tree
Hide file tree
Showing 119 changed files with 5,253 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.DS_Store
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 The GitHub Training Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
47 changes: 47 additions & 0 deletions README.docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
** # Deprecated please do not follow links in this guide**
# Migrating to GitHub Actions Facilitator Guide

Welcome to the Migrating to GitHub Actions offering repo. In this repo, you will find the content used by GitHub during our official actions training and consulting.

If you have access to this repository, it is because your company has an agreement with GitHub to use these materials. Your use of these materials is described by that agreement.

## Deploy the manual

This guid is currently deployed to GitHub pages and can be found here

If you would like to contribute to the guide follow the steps in the **Preview changes on your machine** section.

<!--
These manuals are designed to be generated using [docsify](https://docsify.js.org). To get your own manuals up and running, all you have to do is:
1. Fork this repository
2. In your fork, click on **Settings**
3. Scroll down to the GitHub Pages section, and set **Source:** to `master branch /docs folder`.
4. Click **Save**.
5. Return to the GitHub Pages section of Settings, and you'll receive the URL of your published manual.
-->

## Make changes

The official [docsify documentation](https://docsify.js.org/#/?id=docsify) is your best bet for getting up to speed with the tool.

In general, you'll find all of the manual content in the [`docs/`](docs/) folder of this repository. All content is written in Markdown, and it's all stitched together in [`docs/_sidebar.md`](docs/_sidebar.md), which specifies the order and hierarchy of the content.

#### Mermaid-js

This manual makes use of [mermaid-js](https://mermaid-js.github.io/mermaid/#/) specifically for the use of `stateDiagram`. Should you need to update, or want to add, a new `stateDiagram` using this library will allow the custom CSS to be applied for consistency.

Any diagrams can be written directly in markdown with the [mermaid syntax](https://mermaid-js.github.io/mermaid/#/stateDiagram) however it is important to note that docsify and mermaid struggle to work well together, so once a new `stateDiagram` is created it is best to save a screenshot of it and use it within the markdown vs the raw mermaid chart.

Doing so will prevent mermaid from breaking as you go to a new page.

## Preview changes on your machine

You can install, and serve the contents of the `docs/` folder locally with minimal setup. The steps are thoroughly described in the [doscify quick start](https://docsify.js.org/#/quickstart) guide.

**steps:**

1. `npm i docsify-cli -g`
2. `docsify serve docs`

View the locally running version of this guide at `http://localhost:3000`
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# GitHub-Actions-Docker-training
Training exercise repository for GitHub Actions using a docker base. This repository should be cloned and used for training purposes. Once cloned, the user can follow the directions inside to help understand how to set up basic and complex **Github Actions**.

## How to Use
- Clone this repository to your local **GitHub organization** or **user account**
- You can do so by [changing the repository's remote URL](https://docs.github.com/en/free-pro-team@latest/github/using-git/changing-a-remotes-url) with
```
git remote set-url origin https://github.com/USERNAME/REPOSITORY.git
```
- Locate the `Exercises` folder
- Follow [the directions](https://github.com/githubtraining/GitHub-Actions-Docker-training/blob/main/Exercises/README.md) for individual use cases at your leisure
Binary file added assets/case-study-pdfs/coletiv case study.pdf
Binary file not shown.
222 changes: 222 additions & 0 deletions assets/facilitator-assets/manual.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
# Delivery guidance

This document is designed to help facilitators understand the intent of the sections within this guide. Alongside intent, facilitators will find additional questions and discussion topics throughout this document that will aide them in the presentation of this offering.

**This is meant to be an internal document**.

#### Notes

As per the facilitators discretion, based on your scoping call with the customer, take time at the end of each section to discuss implementing the preceding training into the project that was decided upon.

This will allow the customer to immediately apply what they learned to an implementation plan for their project.

---

## Getting Started

### 00.0_getting-started.md

#### Purpose

This activity is just an opportunity for introductions and for the facilitator to start to gauge the current level of GitHub Actions familiarity. This activity is best served in a round robin approach with everyone in the room having a few seconds to introduce themselves.

This is especially important when the people attending are **not** a part of the same team or organization!

#### Notes

Although this activity is slated for **~15 minutes** there are many cases where this could be a much shorter, or longer activity. These timings are loose and cab be flexible to meet the needs of the group attending the offering.

#### Questions

During delivery, some attendees may have prior CI/CD, automation or actions experience. In that event here are some follow up questions that can be asked to make the conversation more robust.

- Do you find yourself using community driven actions or are you confined to private actions?
- What are some of the benefits you've gained from using actions opposed to another platform?
- Can you describe the process you used while adopting GitHub Actions?
- Have you written any custom actions?
- Were they Docker container or JavaScript actions?
- Did you publish them to the marketplace?
- Are they open-source?
- How does you currently share workflows/actions across teams?

---

## Introduction to GitHub Actions

### 01.0_actions-intro.md

#### Notes

This portion of the presentation introduces the first of many workflows. This workflow is incredibly simple and attempts to demonstrate the very basics of how a workflow executes.

It is advisable to keep it very high-level at this point as there are many more workflow snippets that cover more complex use cases as you progress through the presentation.

### 01.1_actions-about.md

#### Purpose

This portion introduces us to the first of many case studies surrounding GitHub Actions. Although it may seem a bit early to introduce a case study, the purpose of this examination is not to dive deep into actions. Rather, this case study exists at this point because Coletiv used workflows that were **not overly complex** to reach their desired end state.

This was also Coletiv's first attempt at integrating GitHub Actions into their software development life cycle.

#### Notes

Although we will ideally keep things relatively high level at this point in the training, the two workflows presented in this case study do offer the facilitator the ability to go into more detail if the attendees of this offering have some experience with GitHub Actions.

A nice thing to highlight here is the variety of techniques used for a given step in their workflows. For example, some steps use `run` commands, others use public actions from the community and the remaining use the actions that are maintained by GitHub.

#### Questions

If the discussion at the end of the case study does not yield the desired results, here are some ideas to help create a better experience:

1. Consider adding discussion around these keys in the yaml file:

- env
- if
- with

2. Be advised that you may be asked about the differences between `with` and `env` while covering this case study, you can elaborate here or you can defer to a section that will cover those keywords later.

3. You could potentially discuss how the branch filtering and step logic are working together, again that is covered a bit later.

4. You can also point the attendees to the actual article to look through that as well, there are some pictures of the output and intermediate workflow files they worked with.

### 01.2_actions-pricing.md

#### Purpose

This slide exists to show the pricing model.

#### Notes

We think it's best to not only talk about pricing here, but also to help define what counts as "usage".

A major point to make here, is that under the **free** tier the pricing and usage limits apply to **private repos** and not their **public repos**.

### 01.3_actions-starter-workflows.md

#### Purpose

Getting started with GitHub Actions is easy. There are templates to help you get going.

#### Notes

This is a really good opportunity to break from the presentation and go explore a few of these starter workflows in the actions tab of a repository.

### 01.4_actions-hello.md

#### Purpose

This exercise will take the course to Learning Lab to get a little hands on experience with writing a really basic "hello world" for workflows.

#### Notes

As a facilitator, you should familiarize yourself with each of these courses so you can answer questions and troubleshoot the course if need be.

We recommend guiding the attendees through these courses by doing it alongside of them and having them keep pace with you as you progress through the lab.

**Changes to Learning Lab and the courses within it, especially those which utilize actions, happen frequently. Please go through the Learning Path with a fresh registration before every delivery to ensure there are no breaking changes.**

If you do notice a breaking change contact the `services-programs` team by opening an issue in the [services repo](https://github.com/github/services) using the `Programs: Request Help` issue template.

---

## Creating Workflows

### 02.1_actions-ecosystem.md

#### Purpose

The overarching purpose of this section is to get the attendees very comfortable with writing workflow files.

#### Notes

This section contains as series of diagrams made with `Mermaid.js`. The digram in this file should read like this:

- Events trigger workflows
- Workflows contain jobs
- Jobs are what are responsible for execution of actions
- During, and after, action execution status reports about the workflow run are generated.

The arrows don't label well with `docsify` and `Mermaid.js` but are intended to be a cause and effect sort of relationship.

### 02.2 through 02.5

#### Purpose

I wanted to really dive into the keywords in the workflow syntax and spend some time explaining all of the options each bring to the table.

You will find supporting workflow snippets that show how to implement these keywords and their options.

#### Notes

Again, these diagrams are designed to show at which phase in a workflow life cycle the current component exists. I have also expanded all of the properties for a given component to help highlight the options available to those writing workflow files.

### 02.6_reporting.md

#### Purpose

Since we don't interact with logs directly, I felt it necessary to add screenshot on what these may look like.

#### Notes

A really good use of this section would be to leave the presentation and go explore the logs in some public repositories.

Here are a few repos that utilize actions that you can explore the logs of:

[Pandas Python Library](https://github.com/pandas-dev/pandas/actions)
[Go Cobra Module](https://github.com/spf13/cobra/actions)
[NumPy Python Library](https://github.com/numpy/numpy/actions)
[Commander.js](https://github.com/tj/commander.js/actions)
[Free Code Camp](https://github.com/freeCodeCamp/freeCodeCamp/actions)

Consider tracing back the logs to identify the exact event that triggered the workflow. Be sure to look at both failed and successful workflows for a complete experience.

---

## Continuous Deliver/Deployment

### 04.5_cd-learning-path.md

#### Purpose

Guide attendees through the specified courses in the Learning Path.

#### Notes

This path contains courses to deploy to Azure and AWS. Both of which require initial setup, such as having Azure and AWS accounts.

You should at a minimum demo at least one of these courses if the attendees do not have the ability to create accounts on their own.

You could, if you and the attendees want to, cover both of these courses. Even though the application in these courses is the same, the deployment method varies.

- AWS deploys a Node.js app in a serverless fashion
- Azure deploys a Docker container with the same Node.js app inside of it

Both have extra workflow examples if you'd like more material to talk through.

---

## Action Overview

### 05.5_actions-runner-env.md

#### Purpose

It is important that developers/users are aware of the runner nuances. This sections hopes to introduce more information about a runner and establish best practices in using what is already provide by the runner rather than rolling your own solution.

#### Notes

This section is a perfect spot to explore the environment variables within each runner.

Some variables that are worth talking about are:

- `GITHUB_ACTOR`
- `GITHUB_REF`
- `GITHUB_EVENT_NAME`

It is also worthwhile to talk about how these variables work alongside as well as differ from the `github context` as there is a fair amount of naming overlap.

The way Docker behaves in a runner is also something that should be discussed here. One point of contention that shows up in a lot of issues is that GitHub Actions overwrites the `workdir` when it spawns the Docker container. **There does not seem to be a way to change this behavior** as such, every containers working directory will be `/github/workspace/` and that makes working with Docker a bit challenging.

A ton of software comes packed into these runners as well, so much that it doesn't make sense to include it in the presentation. This would be the perfect area to open the help docs and explore some of the available pieces of software so that the attendees have an idea of what exists.
11 changes: 11 additions & 0 deletions dependencies/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

source "https://rubygems.org"

git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }

gem "rubocop", "~> 0.82.0"
gem "rubocop-github", "~> 0.16.0"
gem "rubocop-performance", "~>1.7.1"
gem "rubocop-rails", "~> 2.5"
gem "rubocop-rspec", "~> 1.41.0"
20 changes: 20 additions & 0 deletions dependencies/Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]

[packages]
Django = "*"
django-cors-middleware = "*"
django-extensions = "*"
djangorestframework = "*"
PyJWT = "*"
six = "*"

[requires]
python_version = "3.5"

[pipenv]
allow_prereleases = true
8 changes: 8 additions & 0 deletions dependencies/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "demo-action",
"dependencies": {
"jsonlint": "^1.6.3",
"markdownlint-cli": "^0.26.0",
"prettyjson": "^1.2.1"
}
}
Empty file added docs/.nojekyll
Empty file.
23 changes: 23 additions & 0 deletions docs/00.0_getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## What can I expect? {docsify-ignore-all}

> - Introductions
> - Discuss goals of the training
> - Detailed course on the GitHub Actions platform
> - Hands-on facilitator guided learning
> - Help with migrating a project to GitHub Actions
> - Discuss logistics (timing of course, recording, etc.)
👈 **Our focus will be on the topics you see listed on the left in the navigation bar**

GitHub Actions makes it easy to automate all your software workflows. GitHub Actions enables you to:

- Build, test, and deploy your code with world class CI/CD right from GitHub.
- Make code reviews, branch management, and issue triaging work the way you want through community and custom shareable components.

### Exercises
Throughout this course we will be doing exercises that will build your knowledge of GitHub Actions.

#### Prequisites
- Text Editor
- Docker
- A GitHub Account
Loading

0 comments on commit dad29ab

Please sign in to comment.