38 | Find Actions on GitHub Marketplace at github.com/marketplace
39 | Read about GitHub Actions at help.github.com/actions
40 | Join a GitHub Learning Lab course at lab.github.com
41 |
42 |
43 | `
44 | }
45 |
--------------------------------------------------------------------------------
/theme/fonts/style.css:
--------------------------------------------------------------------------------
1 | /* #### Generated By: http://www.cufonfonts.com #### */
2 |
3 | @font-face {
4 | font-family: 'Inter UI Regular';
5 | font-style: normal;
6 | font-weight: normal;
7 | src: local('Inter UI Regular'), url('Inter-UI-Regular.woff') format('woff');
8 | }
9 |
10 |
11 | @font-face {
12 | font-family: 'Inter UI Italic';
13 | font-style: normal;
14 | font-weight: normal;
15 | src: local('Inter UI Italic'), url('Inter-UI-Italic.woff') format('woff');
16 | }
17 |
18 |
19 | @font-face {
20 | font-family: 'Inter UI Medium';
21 | font-style: normal;
22 | font-weight: normal;
23 | src: local('Inter UI Medium'), url('Inter-UI-Medium.woff') format('woff');
24 | }
25 |
26 |
27 | @font-face {
28 | font-family: 'Inter UI Medium Italic';
29 | font-style: normal;
30 | font-weight: normal;
31 | src: local('Inter UI Medium Italic'), url('Inter-UI-MediumItalic.woff') format('woff');
32 | }
33 |
34 |
35 | @font-face {
36 | font-family: 'Inter UI Bold';
37 | font-style: normal;
38 | font-weight: normal;
39 | src: local('Inter UI Bold'), url('Inter-UI-Bold.woff') format('woff');
40 | }
41 |
42 |
43 | @font-face {
44 | font-family: 'Inter UI Bold Italic';
45 | font-style: normal;
46 | font-weight: normal;
47 | src: local('Inter UI Bold Italic'), url('Inter-UI-BoldItalic.woff') format('woff');
48 | }
49 |
50 |
51 | @font-face {
52 | font-family: 'Inter UI Black';
53 | font-style: normal;
54 | font-weight: normal;
55 | src: local('Inter UI Black'), url('Inter-UI-Black.woff') format('woff');
56 | }
57 |
58 |
59 | @font-face {
60 | font-family: 'Inter UI Black Italic';
61 | font-style: normal;
62 | font-weight: normal;
63 | src: local('Inter UI Black Italic'), url('Inter-UI-BlackItalic.woff') format('woff');
64 | }
--------------------------------------------------------------------------------
/theme/assets/style.css:
--------------------------------------------------------------------------------
1 | @import 'https://fonts.googleapis.com/css?family=Roboto:400,500';
2 |
3 | @page {
4 | size: 210mm 297mm;
5 | margin: 0;
6 | padding: 0;
7 | }
8 |
9 | html, body {
10 | margin: 0;
11 | padding: 0;
12 | color: #4a4a4a;
13 | text-align: justify;
14 | }
15 |
16 | html {
17 | font-family: 'Inter UI', 'DejaVu Sans', Arial, sans-serif;
18 | font-size: 9pt;
19 | font-weight: 450;
20 | }
21 |
22 | body {
23 | display: flex;
24 | flex-direction: column;
25 | }
26 |
27 | header {
28 | background-color: #1C3260;
29 | padding: 30px;
30 | display: block;
31 | grid-template-columns: auto 1fr auto;
32 | padding-right: 12em;
33 | align-items: center;
34 | color: white;
35 | }
36 |
37 | header > a {
38 | color: white;
39 | }
40 |
41 | header > .wordmark {
42 | max-height: 3em;
43 | }
44 |
45 | header > .logo {
46 | position: absolute;
47 | top: 1em;
48 | right: 3em;
49 | max-width: 6em;
50 | }
51 |
52 | section.byline {
53 | width: 100%;
54 | background-color: #1C4586;
55 | color: white;
56 | }
57 |
58 | section.byline div {
59 | padding: 40px;
60 | }
61 |
62 |
63 | h1 {
64 | font-size: 26pt;
65 | padding: 0;
66 | padding-left: 10px;
67 | font-weight: 400;
68 | }
69 |
70 | h2 {
71 | font-weight: 500;
72 | color: #4842a5;
73 | font-size: 1.4em;
74 | font-weight: 800;
75 | }
76 |
77 | h3 {
78 | font-size: 1.2em;
79 | font-weight: 700;
80 | }
81 |
82 | h4, h5 {
83 | font-size: 1.1em;
84 | font-weight: 800
85 | }
86 |
87 | h1, h2, h3, h4, h5 {
88 | margin: 0;
89 | }
90 |
91 | a {
92 | color: #4842a5;
93 | text-decoration: none;
94 | }
95 |
96 | ul {
97 | padding-left: 10px;
98 | margin-top: 2px;
99 | margin-bottom: 2px;
100 | }
101 |
102 | li > p {
103 | margin: 0;
104 | }
105 |
106 | p.paragraph {
107 | margin-top: 2px;
108 | margin-bottom: 2px;
109 | }
110 |
111 | section.content {
112 | position: relative;
113 | align-self: center;
114 | width: 100%;
115 | display: flex;
116 | flex-flow: column;
117 | align-items: center;
118 | }
119 |
120 | .sectionbody {
121 | position: relative;
122 | margin: 0.5cm;
123 | margin-bottom: 0cm;
124 | width: 20cm;
125 | align-self: center;
126 | display: flex;
127 | }
128 |
129 | .sect3 {
130 | margin-top: 10px;
131 | }
132 |
133 | .noTopMargin {
134 | margin-top: 0px;
135 | }
136 |
137 |
138 | code, .listingblock {
139 | background-color: lightgrey;
140 | }
141 |
142 | .column {
143 | position: relative;
144 | margin: 0;
145 | padding: 10px;
146 | padding-top: 0px;
147 | width: 10cm;
148 | }
149 |
150 | .hide {
151 | display: none;
152 | }
153 |
154 | .sect1 > h2 {
155 | display: none;
156 | }
157 |
158 | .column > h3 {
159 | display: none;
160 | }
161 |
162 | .page {
163 | page-break-after: always;
164 | }
165 |
166 | .page:nth-of-type(1) {
167 | height: 223mm;
168 | }
169 |
170 | .header-nth {
171 | position: relative;
172 | height: 40px;
173 | width: 100%;
174 | background-color: #1C3260;
175 | display: flex;
176 | align-items: stretch;
177 | }
178 |
179 | .header-nth .sectionbody {
180 | margin-bottom: 0.5cm;
181 | }
182 |
183 | .header-nth p {
184 | font-size: 12pt;
185 | font-weight: 400;
186 | color: white;
187 | padding-left: 5px;
188 | padding-top: 1px;
189 | }
190 |
191 | section.footer {
192 | position: relative;
193 | height: 85px;
194 | width: 100%;
195 | color: white;
196 | background-color: #1C3260;
197 | display: flex;
198 | align-items: center;
199 | }
200 |
201 | .adFootnote {
202 | flex: 0 1 50%;
203 | max-width: 50%;
204 | margin-left: 0.5cm;
205 | }
206 |
207 | .helpFootnote {
208 | display: flex;
209 | flex: 0 1 50%;
210 | flex-direction: column;
211 | max-width: 50%;
212 | margin-right: 0.5cm;
213 | font-size: 8pt;
214 | }
215 |
216 | .helpFootnote ul {
217 | list-style-type: none;
218 | }
219 |
220 | .adFootnote .footerHeadline {
221 | display: flex;
222 | align-items: center;
223 | }
224 |
225 |
226 | .adFootnote .footerHeadline img {
227 | height: 30px;
228 | }
229 |
230 |
231 | .adFootnote .footerHeadline span {
232 | font-family: 'Inter UI';
233 | font-size: 14pt;
234 | font-weight: bold;
235 | }
236 |
237 | .adFootnote .subNote {
238 | padding-left: 6px;
239 | }
240 |
241 |
242 | /*
243 | .helpFootnote li:nth-of-type(1) {
244 | padding: 5px 0px 5px 0px;
245 | }
246 |
247 | .helpFootnote li:nth-of-type(n+2) {
248 | padding: 0px 0px 5px 0px;
249 | }
250 |
251 | .header-nth .sectionbody::before {
252 | content:url('github.png');
253 | display: inline-flex;
254 | max-inline-size: 60px;
255 | }
256 |
257 | .footer {
258 | position: absolute;
259 | bottom: 0px;
260 | height: 60px;
261 | width: 100%;
262 | background-color: #1C3260;
263 | }
264 |
265 | @media only screen {
266 | .footer {
267 | position: relative;
268 | }
269 | }
270 | */
271 |
--------------------------------------------------------------------------------
/theme/fonts/OFL.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) , (),
2 | with Reserved Font Name .
3 | Copyright (c) , (),
4 | with Reserved Font Name .
5 | Copyright (c) , ().
6 |
7 | This Font Software is licensed under the SIL Open Font License, Version 1.1.
8 | This license is copied below, and is also available with a FAQ at:
9 | http://scripts.sil.org/OFL
10 |
11 |
12 | -----------------------------------------------------------
13 | SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
14 | -----------------------------------------------------------
15 |
16 | PREAMBLE
17 | The goals of the Open Font License (OFL) are to stimulate worldwide
18 | development of collaborative font projects, to support the font creation
19 | efforts of academic and linguistic communities, and to provide a free and
20 | open framework in which fonts may be shared and improved in partnership
21 | with others.
22 |
23 | The OFL allows the licensed fonts to be used, studied, modified and
24 | redistributed freely as long as they are not sold by themselves. The
25 | fonts, including any derivative works, can be bundled, embedded,
26 | redistributed and/or sold with any software provided that any reserved
27 | names are not used by derivative works. The fonts and derivatives,
28 | however, cannot be released under any other type of license. The
29 | requirement for fonts to remain under this license does not apply
30 | to any document created using the fonts or their derivatives.
31 |
32 | DEFINITIONS
33 | "Font Software" refers to the set of files released by the Copyright
34 | Holder(s) under this license and clearly marked as such. This may
35 | include source files, build scripts and documentation.
36 |
37 | "Reserved Font Name" refers to any names specified as such after the
38 | copyright statement(s).
39 |
40 | "Original Version" refers to the collection of Font Software components as
41 | distributed by the Copyright Holder(s).
42 |
43 | "Modified Version" refers to any derivative made by adding to, deleting,
44 | or substituting -- in part or in whole -- any of the components of the
45 | Original Version, by changing formats or by porting the Font Software to a
46 | new environment.
47 |
48 | "Author" refers to any designer, engineer, programmer, technical
49 | writer or other person who contributed to the Font Software.
50 |
51 | PERMISSION & CONDITIONS
52 | Permission is hereby granted, free of charge, to any person obtaining
53 | a copy of the Font Software, to use, study, copy, merge, embed, modify,
54 | redistribute, and sell modified and unmodified copies of the Font
55 | Software, subject to the following conditions:
56 |
57 | 1) Neither the Font Software nor any of its individual components,
58 | in Original or Modified Versions, may be sold by itself.
59 |
60 | 2) Original or Modified Versions of the Font Software may be bundled,
61 | redistributed and/or sold with any software, provided that each copy
62 | contains the above copyright notice and this license. These can be
63 | included either as stand-alone text files, human-readable headers or
64 | in the appropriate machine-readable metadata fields within text or
65 | binary files as long as those fields can be easily viewed by the user.
66 |
67 | 3) No Modified Version of the Font Software may use the Reserved Font
68 | Name(s) unless explicit written permission is granted by the corresponding
69 | Copyright Holder. This restriction only applies to the primary font name as
70 | presented to the users.
71 |
72 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
73 | Software shall not be used to promote, endorse or advertise any
74 | Modified Version, except to acknowledge the contribution(s) of the
75 | Copyright Holder(s) and the Author(s) or with their explicit written
76 | permission.
77 |
78 | 5) The Font Software, modified or unmodified, in part or in whole,
79 | must be distributed entirely under this license, and must not be
80 | distributed under any other license. The requirement for fonts to
81 | remain under this license does not apply to any document created
82 | using the Font Software.
83 |
84 | TERMINATION
85 | This license becomes null and void if any of the above conditions are
86 | not met.
87 |
88 | DISCLAIMER
89 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
90 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
91 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
92 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
93 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
94 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
95 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
96 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
97 | OTHER DEALINGS IN THE FONT SOFTWARE.
98 |
--------------------------------------------------------------------------------
/actions-cheat-sheet.adoc:
--------------------------------------------------------------------------------
1 | = Actions Cheat Sheet
2 | :page-description: A quick reference for GitHub Actions
3 | :byline: GitHub Actions give you the flexibility to build automated software development lifecycle workflows. You can write individual tasks, called actions, and combine them to create custom workflows in your repository. GitHub Actions are automated processes allowing you to build, test, package, release, or deploy any code project on GitHub, but you can also use them to automate any step of your workflow: merging pull requests, assigning labels, triaging issues to name a few.
4 | :pdf-width: 210mm
5 | :pdf-height: 297mm
6 |
7 | [.page]
8 | == !
9 |
10 | [.column]
11 | === !
12 | [.noTopMargin]
13 | ==== Workflow Syntax
14 | Workflow files use YAML syntax, and must have either a .yml or .yaml file extension. You must store workflow files in the `.github/workflows/` directory of your repository. Each different YAML file corresponds to a different workflow.
15 |
16 | [source,yaml]
17 | ----
18 | name: My Workflow
19 | on:
20 | push:
21 | branches:
22 | - 'releases/*'
23 | - '!releases/**-alpha'
24 | env:
25 | message: 'conversation'
26 | my_token: ${{ secrets.GITHUB_TOKEN }}
27 | jobs:
28 | my_build:
29 | runs-on: ubuntu-latest
30 | steps:
31 | - name: Checking out our code
32 | uses: actions/checkout@master
33 | - name: Say something
34 | run: |
35 | echo "A little less ${message}"
36 | echo "A little more action"
37 | my_job:
38 | needs: my_build
39 | container:
40 | image: node:10.16-jessie
41 | env:
42 | NODE_ENV: development
43 | ports:
44 | - 80
45 | volumes:
46 | - my_docker_volume:/volume_mount
47 | options: --cpus 1
48 | services:
49 | redis:
50 | image: redis
51 | ports:
52 | - 6379/tcp
53 | ----
54 |
55 | ==== Workflow `name`
56 | The name of your workflow will be displayed on your repository's actions page.
57 |
58 | ==== Workflow, Job or Step `env`
59 | A map of environment variables which can be set at different scopes. Several environment variables are available by default (`GITHUB_SHA`, `GITHUB_REF`, `GITHUB_EVENT_NAME`, `HOME`, `GITHUB_EVENT_PATH`...) as well as a secret, `GITHUB_TOKEN`, which you can leverage for API calls or git commands through the `secrets` context.
60 |
61 | [.column]
62 | === !
63 | [.noTopMargin]
64 | ==== `on` Event
65 | The type event that triggers the workflow. You can provide a single event string, an array of events, or an event configuration map that restricts the execution of a workflow:
66 |
67 | * When using the `push` and `pull_request` events, `branches` and `tags` allow to select or exclude (with the `!` prefix) git references the workflow will run on, while `paths` specifies which files must have been modified in order to run the workflow.
68 |
69 | * If your rules are only made of exclusions, you can use `branches-ignore`, `tags-ignore` and `paths-ignore`. The `-ignore` form and its inclusive version cannot be mixed.
70 |
71 | * The `types` keyword enables you to narrow down activities (`opened`, `created`, `edited`...) causing the workflow to run. The list of available activities depends on the event.
72 |
73 | * A workflow trigger can also be scheduled:
74 |
75 | [source,yaml]
76 | ----
77 | on:
78 | schedule:
79 | - cron: '*/15 * * * *'
80 | ----
81 |
82 | ==== `jobs` Collection
83 | A workflow run is made up of one or more jobs identified by a unique `job_id` (`my_build` or `my_job`). Jobs run in parallel by default unless queued with the `needs` attribute. Each job runs in a fresh instance of the virtual environment specified by `runs-on`.
84 |
85 | ===== Job `name`
86 | The name of the job displayed on GitHub.
87 |
88 | ===== `needs`
89 | Identifies any job that must complete successfully before this job will run. It can be a string or array of strings. If a job fails, all jobs that need it are skipped unless the jobs use a conditional statement that causes the job to continue.
90 |
91 | ===== `runs-on`
92 | The type of virtual host machine to run the job on. Can be either a GitHub or self-hosted runner. Jobs can also run in user-specified containers (see: `container`). Available GitHub-hosted virtual machine types are `ubuntu-latest`, `windows-latest`, `macOS-latest` plus some other specific versions for each operating system, in the form of `ubuntu-xx.xx`, `macOS-xx.xx` or `windows-xxxx`. To specify a self-hosted runner for your job, configure `runs-on` in your workflow file with self-hosted runner labels. Example: `[self-hosted, linux]`.
93 |
94 | [.header-nth]
95 | == !
96 | image::theme/assets/github.png[GitHub Logo,60]
97 | Actions Cheat Sheet
98 |
99 | [.page]
100 | == !
101 |
102 | [.column]
103 | === !
104 |
105 | ===== `container`
106 | Instead of running directly on a host selected with `runs-on`, a container can run any steps in a job that don't already specify a container. If you have steps that use both script and container actions, the container actions will run as sibling containers on the same network with the same volume mounts. This object has the following attributes: `image`, `env`, `ports`, `volume` and `options`.
107 |
108 | ===== `timeout-minutes`
109 | The maximum number of minutes to let a workflow run before GitHub automatically cancels it. Default: 360
110 |
111 | ===== `services`
112 | Additional containers to host services for a job in a workflow. These are useful for creating databases or cache services. The runner on the virtual machine will automatically create a network and manage the lifecycle of the service containers. Each service is a named object in the `services` collection (`redis` or `nginx` for example) and can receive the same parameters than the `container` object.
113 |
114 | ==== Job `steps`
115 | A job contains a sequence of tasks called `steps`. Steps can run commands, run setup tasks, or run an action from your repository, a public repository, or an action published in a Docker registry. Each step runs in its own process in the virtual environment and has access to the workspace and filesystem.
116 |
117 | ===== Step `name`
118 | Specify the label to be displayed for this step in GitHub. It's not required but does improve readability in the logs.
119 |
120 | ===== `uses`
121 | Specify an action to run as part of a step in your job. You can use an action defined in the same repository as the workflow, a public repository elsewhere on GitHub, or in a published Docker container image. Including the version of the action you are using by specifying a Git ref, branch, SHA, or Docker tag is strongly recommended:
122 |
123 | * `uses: {owner}/{repo}@{ref}` for actions in a public repository
124 |
125 | * `uses: {owner}/{repo}/{path}@{ref}` for actions in a subdirectory of a public repository
126 |
127 | * `uses: ./path/to/dir` for actions in a a subdirectory of the same repository
128 |
129 | * `uses: docker://{image}:{tag}` for actions on Docker Hub
130 |
131 | * `uses: docker://{host}/{image}:{tag}` for actions in a public registry
132 |
133 | ===== `with`
134 | A map of the input parameters defined by the action in its `action.yml` file. When the acion is container based, special parameter names are:
135 |
136 | * `args`, a string that defines the inputs passed to a Docker container's `ENTRYPOINT`. It is used in place of the `CMD` instruction in a `Dockerfile`.
137 |
138 | * `entrypoint`, a string that defines or overrides the executable to run as the Docker container's `ENTRYPOINT`.
139 |
140 | ===== `if`
141 | Prevents a step from running unless a condition is met. The value is an expression without the `${{ ... }}` block.
142 |
143 | [.column]
144 | === !
145 | ===== `run`
146 | Instead of running an existing action, a command line program can be run using the operating system's shell. Each run keyword represents a new process and shell in the virtual environment. A specific shell can be selected with the `shell` attribute. Multiple commands can be run in a single shell instance using the `|` (pipe) operator.
147 |
148 | ==== Job `strategy`
149 | A build matrix strategy is a set of different configurations of the virtual environment. The job’ set of steps will be executed on each of these configurations. The following exemple specifies 3 nodejs versions on 2 operating systems:
150 |
151 | [source,yaml]
152 | ----
153 | runs-on: ${{ matrix.os }}
154 | strategy:
155 | matrix:
156 | os: [ubuntu-16.04, ubuntu-18.04]
157 | node: [6, 8, 10]
158 | steps:
159 | - uses: actions/setup-node@v1
160 | with:
161 | node-version: ${{ matrix.node }}
162 | ----
163 |
164 | ===== `fail-fast`
165 | When set to `true` (default value), GitHub cancels all in-progress jobs if any of the matrix job fails.
166 |
167 | ==== Context and expressions
168 | Expressions can be used to programmatically set variables in workflow files and access contexts. An expression can be any combination of literal values, references to a context, or functions. You can combine literals, context references, and functions using operators. With the exception of the `if` key, expressions are written in a `${{ ... }}` block. Contexts are objects providing access to runtime information. The following objects are available: `github`, `job`, `steps`, `runner`, `secrets`, `strategy` and `matrix`.
169 |
170 | ==== Artifact storage & Caching
171 | An artifact is a file or collection of files produced during a workflow run that can be stored and shared between jobs in a workflow run. Use actions `actions/upload-artifact` and `actions/download-artifact` with parameters `name` and `path` to manipulate artifacts. Artifacts can be downloaded through the Web interface for 90 days.
172 |
173 | For dependencies and other commonly reused files across runs of a given workflow, use the `actions/cache` action with parameters:
174 |
175 | * `key`: The key used to save and search for a cache.
176 |
177 | * `path`: The file path (absolute or relative to the working directory) on the runner to cache or restore.
178 |
179 | * `restore-keys`: Optional - An ordered list of alternative keys to use for finding the cache if no cache hit occurred for key.
180 |
181 | [source,yaml]
182 | ----
183 | - uses: actions/checkout@v1
184 | - name: Cache node modules
185 | uses: actions/cache@v1
186 | with:
187 | path: node_modules
188 | key: x-y-${{hashFiles('**/package-lock.json')}}
189 | restore-keys: |
190 | x-y-
191 | x-
192 | ----
193 |
--------------------------------------------------------------------------------
/actions-cheat-sheet.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
Actions Cheat Sheet
11 |
12 |
13 |
14 |
GitHub Actions give you the flexibility to build automated software development lifecycle workflows. You can write individual tasks, called actions, and combine them to create custom workflows in your repository. GitHub Actions are automated processes allowing you to build, test, package, release, or deploy any code project on GitHub, but you can also use them to automate any step of your workflow: merging pull requests, assigning labels, triaging issues to name a few.
15 |
16 |
17 |
18 |
!
19 |
20 |
21 |
!
22 |
23 |
Workflow Syntax
24 |
Workflow files use YAML syntax, and must have either a .yml or .yaml file extension. You must store workflow files in the .github/workflows/ directory of your repository. Each different YAML file corresponds to a different workflow.
The name of your workflow will be displayed on your repository’s actions page.
68 |
69 |
70 |
Workflow, Job or Step env
71 |
A map of environment variables which can be set at different scopes. Several environment variables are available by default (GITHUB_SHA, GITHUB_REF, GITHUB_EVENT_NAME, HOME, GITHUB_EVENT_PATH…) as well as a secret, GITHUB_TOKEN, which you can leverage for API calls or git commands through the secrets context.
72 |
73 |
74 |
75 |
!
76 |
77 |
on Event
78 |
The type event that triggers the workflow. You can provide a single event string, an array of events, or an event configuration map that restricts the execution of a workflow:
79 |
80 |
81 |
82 |
When using the push and pull_request events, branches and tags allow to select or exclude (with the ! prefix) git references the workflow will run on, while paths specifies which files must have been modified in order to run the workflow.
83 |
84 |
85 |
If your rules are only made of exclusions, you can use branches-ignore, tags-ignore and paths-ignore. The -ignore form and its inclusive version cannot be mixed.
86 |
87 |
88 |
The types keyword enables you to narrow down activities (opened, created, edited…) causing the workflow to run. The list of available activities depends on the event.
89 |
90 |
91 |
A workflow trigger can also be scheduled:
92 |
93 |
94 |
95 |
96 |
97 |
on:
98 | schedule:
99 | - cron: '*/15 * * * *'
100 |
101 |
102 |
103 |
104 |
jobs Collection
105 |
A workflow run is made up of one or more jobs identified by a unique job_id (my_build or my_job). Jobs run in parallel by default unless queued with the needs attribute. Each job runs in a fresh instance of the virtual environment specified by runs-on.
106 |
107 |
Job name
108 |
The name of the job displayed on GitHub.
109 |
110 |
111 |
needs
112 |
Identifies any job that must complete successfully before this job will run. It can be a string or array of strings. If a job fails, all jobs that need it are skipped unless the jobs use a conditional statement that causes the job to continue.
113 |
114 |
115 |
runs-on
116 |
The type of virtual host machine to run the job on. Can be either a GitHub or self-hosted runner. Jobs can also run in user-specified containers (see: container). Available GitHub-hosted virtual machine types are ubuntu-latest, windows-latest, macOS-latest plus some other specific versions for each operating system, in the form of ubuntu-xx.xx, macOS-xx.xx or windows-xxxx. To specify a self-hosted runner for your job, configure runs-on in your workflow file with self-hosted runner labels. Example: [self-hosted, linux].
117 |
118 |
119 |
120 |
121 |
122 |
123 |
!
124 |
125 |
126 |
127 |
128 |
129 |
130 |
Actions Cheat Sheet
131 |
132 |
133 |
134 |
!
135 |
136 |
137 |
!
138 |
139 |
container
140 |
Instead of running directly on a host selected with runs-on, a container can run any steps in a job that don’t already specify a container. If you have steps that use both script and container actions, the container actions will run as sibling containers on the same network with the same volume mounts. This object has the following attributes: image, env, ports, volume and options.
141 |
142 |
143 |
timeout-minutes
144 |
The maximum number of minutes to let a workflow run before GitHub automatically cancels it. Default: 360
145 |
146 |
147 |
services
148 |
Additional containers to host services for a job in a workflow. These are useful for creating databases or cache services. The runner on the virtual machine will automatically create a network and manage the lifecycle of the service containers. Each service is a named object in the services collection (redis or nginx for example) and can receive the same parameters than the container object.
149 |
150 |
151 |
Job steps
152 |
A job contains a sequence of tasks called steps. Steps can run commands, run setup tasks, or run an action from your repository, a public repository, or an action published in a Docker registry. Each step runs in its own process in the virtual environment and has access to the workspace and filesystem.
153 |
154 |
Step name
155 |
Specify the label to be displayed for this step in GitHub. It’s not required but does improve readability in the logs.
156 |
157 |
158 |
uses
159 |
Specify an action to run as part of a step in your job. You can use an action defined in the same repository as the workflow, a public repository elsewhere on GitHub, or in a published Docker container image. Including the version of the action you are using by specifying a Git ref, branch, SHA, or Docker tag is strongly recommended:
160 |
161 |
162 |
163 |
uses: {owner}/{repo}@{ref} for actions in a public repository
164 |
165 |
166 |
uses: {owner}/{repo}/{path}@{ref} for actions in a subdirectory of a public repository
167 |
168 |
169 |
uses: ./path/to/dir for actions in a a subdirectory of the same repository
170 |
171 |
172 |
uses: docker://{image}:{tag} for actions on Docker Hub
173 |
174 |
175 |
uses: docker://{host}/{image}:{tag} for actions in a public registry
176 |
177 |
178 |
179 |
180 |
181 |
with
182 |
A map of the input parameters defined by the action in its action.yml file. When the acion is container based, special parameter names are:
183 |
184 |
185 |
186 |
args, a string that defines the inputs passed to a Docker container’s ENTRYPOINT. It is used in place of the CMD instruction in a Dockerfile.
187 |
188 |
189 |
entrypoint, a string that defines or overrides the executable to run as the Docker container’s ENTRYPOINT.
190 |
191 |
192 |
193 |
194 |
195 |
if
196 |
Prevents a step from running unless a condition is met. The value is an expression without the ${{ … }} block.
197 |
198 |
199 |
200 |
201 |
!
202 |
203 |
run
204 |
Instead of running an existing action, a command line program can be run using the operating system’s shell. Each run keyword represents a new process and shell in the virtual environment. A specific shell can be selected with the shell attribute. Multiple commands can be run in a single shell instance using the | (pipe) operator.
205 |
206 |
207 |
Job strategy
208 |
A build matrix strategy is a set of different configurations of the virtual environment. The job’ set of steps will be executed on each of these configurations. The following exemple specifies 3 nodejs versions on 2 operating systems:
When set to true (default value), GitHub cancels all in-progress jobs if any of the matrix job fails.
225 |
226 |
227 |
228 |
Context and expressions
229 |
Expressions can be used to programmatically set variables in workflow files and access contexts. An expression can be any combination of literal values, references to a context, or functions. You can combine literals, context references, and functions using operators. With the exception of the if key, expressions are written in a ${{ … }} block. Contexts are objects providing access to runtime information. The following objects are available: github, job, steps, runner, secrets, strategy and matrix.
230 |
231 |
232 |
Artifact storage & Caching
233 |
An artifact is a file or collection of files produced during a workflow run that can be stored and shared between jobs in a workflow run. Use actions actions/upload-artifact and actions/download-artifact with parameters name and path to manipulate artifacts. Artifacts can be downloaded through the Web interface for 90 days.
234 |
For dependencies and other commonly reused files across runs of a given workflow, use the actions/cache action with parameters:
235 |
236 |
237 |
238 |
key: The key used to save and search for a cache.
239 |
240 |
241 |
path: The file path (absolute or relative to the working directory) on the runner to cache or restore.
242 |
243 |
244 |
restore-keys: Optional - An ordered list of alternative keys to use for finding the cache if no cache hit occurred for key.
273 | Find Actions on GitHub Marketplace at github.com/marketplace
274 | Read about GitHub Actions at help.github.com/actions
275 | Join a GitHub Learning Lab course at lab.github.com
276 |