0% found this document useful (0 votes)
114 views2 pages

GitHub - Actions Cheat Sheet One Pager

GitHub Actions allows users to automate software development workflows directly within their repositories, utilizing reusable actions for tasks like building and testing projects. Users can start by selecting workflow templates, customizing them, and committing their configurations in YAML format. The document also explains key terms and provides an example workflow for continuous integration with Node.js.

Uploaded by

drpiga
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
114 views2 pages

GitHub - Actions Cheat Sheet One Pager

GitHub Actions allows users to automate software development workflows directly within their repositories, utilizing reusable actions for tasks like building and testing projects. Users can start by selecting workflow templates, customizing them, and committing their configurations in YAML format. The document also explains key terms and provides an example workflow for continuous integration with Node.js.

Uploaded by

drpiga
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Actions

Cheat Sheet
GitHub Actions help you automate your software development workflows in the same
place you store and collaborate on code. Individual actions are reusable pieces of
code that let you build, test, package, or deploy projects on GitHub. But you can also
use them to automate any step of your workflow.

How to get started in 1. Click the “Actions” tab in your repository


GitHub Actions is tightly integrated with your code and with the rest
four simple steps of the experiences on GitHub.

2. Choose the workflow that’s best for your type of project


GitHub Actions offers helpful workflow templates to get you started,
including templates for Node.js, Rust, .NET Core, and more.

3. Customize your workflow


You can start with the workflow templates that we provide, and then
you can customize them to your project’s exact requirements.

4. O
 nce you’ve chosen your workflow, press the “start
commit” button
Your workflow configuration lives in your repository, so the build
definition is versioned alongside the finished code.

Helpful terms to know


Action
A program that becomes a reusable component to be used in code. From your repository, you can view the status of your code
workflows. Actions can install software for the environment, set up changes and detailed logs for each action in your workflow. CI saves
authentication,, or automate complex sets of tasks. You can find developers time by providing immediate feedback on code changes
actions in the GitHub Marketplace, or create your own and share to detect and resolve bugs faster.
them with your community.

YAML
Workflow
YAML stands for “Yet Another Markup Language”. It’s a human-
A configurable, automated process that you can use in your readable markup language commonly used for configuration files,
repository to build, test, package, release, or deploy your project. especially by CI- and DevOps-focused software tools. GitHub
Workflows are made up of one or more “jobs” and can be triggered Actions uses YAML as the basis of its configuration workflows.
by GitHub events.

Workflow file
Continuous integration (CI)
The configuration file that defines your GitHub Actions workflow.
The software development practice of frequently committing small This is written in YAML, and lives inside your GitHub repository in
code changes to a shared repository. With GitHub Actions, you can the .github/workflows directory. Each file in that directory that is
create custom CI workflows that automatically build and test your named with a .yaml extension will define a unique workflow.

Available exclusively through GitHub One


Actions

Cheat Sheet

identifiable in the UI or in logs. Jobs contain a set of steps that will


be executed, in order. This workflow has a single job, the build job.
name: CI for Node.js Project
on:
push:
jobs.<job-id>.runs-on
branches: [ master ] The type of runner to use to run the given job on, either a runner
pull_request: provided by GitHub or a self-hosted runner that you configure.
branches: [ master ] GitHub provides three main types of runners: Linux (named
jobs: ubuntu-latest), Windows (named windows-latest) and macOS
build: (named macos-latest).
runs-on: ubuntu-latest
name: Build and Test jobs.<job-id>.steps
steps:
A list of the steps that will run as part of the job. Each step will run
- uses: actions/checkout@v2
one after another, all on the same virtual environment. By default,
name: Check out repository
if any step fails then the entire job will stop. In this workflow, the
- uses: actions/setup-node@v1
build job contains three steps:
name: Set up Node.js
with: 1. T
 he first step uses an action named actions/checkout@v2.
node-version: 12 This is an action provided by GitHub that will check out your
- run: | repository onto the runner, so that it can be built and tested.
npm ci
2. T
 he second step uses an action named actions/setup-node@
npm run build
v1. This is an action provided by GitHub that will set up a
npm test
particular version of Node.js on the runner. Arguments can be
name: Build and Test
provided to the action in the with section; in this example, the
node-version argument is set to 12, which instructs the action
to put Node.js version 12 in the PATH for subsequent steps.
An explanation of this example workflow: 3. T
 he final step runs programs on the command-line. By
default, these programs will be run with bash (on Linux and
name
macOS) or PowerShell (on Windows). A single command
The name of your workflow will be displayed on your may be specified, or multiple commands can be specified by
repository’s actions page. starting them with a leading pipe (|) symbol.

In this case, a Node.js continuous integration build will be


on
performed by running npm ci to download and install packages
A list of the jobs that run as part of the workflow. Each job from the npm registry, then running npm run build to run the build
will run independently of the others, and will run on a different script specified by the project, and finally running npm test to run
virtual environment. Jobs may have a name to make them easily any unit tests in the project.

Questions about GitHub Actions? Actions guide: https://help.github.com/en/actions


We’re here to help. Questions and answers on Actions: github.community

Available exclusively through GitHub One

You might also like