You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 1, 2022. It is now read-only.
Copy file name to clipboardExpand all lines: course-details.md
+12-2Lines changed: 12 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,5 +2,15 @@
2
2
3
3
Over the duration of this course, approximately 1 hour, you will learn the skills needed to begin using and customizing GitHub Actions in your unique workflow scenarios.
4
4
5
-
**prerequisites**
6
-
It would be very beneficial to you to have JavaScript or other programming familiarity before enrolling in this course.
5
+
**Prerequisites**
6
+
7
+
We will be using Node.js to build our action and GitHub to consume our action. This presents us with a hybrid environment, the Node.js runtime environment and the virtual machine used by GitHub Actions, that you may not be used to if you've taken other Learning Lab courses.
8
+
9
+
Before we can get started there are a few things you need to setup on your **local machine**
10
+
11
+
1. Install [Node.js](https://nodejs.org/en/) for your operating system.
12
+
2. Ensure you have a text editor installed. I'll be using Visual Studio Code, and although you are free to use your editor of choice you should be aware that using a different editor will result in your screen not matching my examples. Here are some editor options for you:
13
+
1.[Visual Studio Code](https://code.visualstudio.com/)**(recommended)**
14
+
2.[Atom](https://atom.io/)
15
+
3.[Sublime Text](https://www.sublimetext.com/)
16
+
3. Lastly, you're going to need a local installation of [Git](https://git-scm.com/) so that you can interact with this repository as you write code.
I'm glad you asked. Let's take a look at the workflow file that we just committed to this repository.
3
+
I'm glad you asked. Let's take a look at the workflow file that we just committed to this repository.
4
4
5
5
```yaml
6
6
name: CI
@@ -9,47 +9,46 @@ on: [push]
9
9
10
10
jobs:
11
11
build:
12
-
13
12
runs-on: ubuntu-latest
14
13
15
14
steps:
16
-
- uses: actions/checkout@v1
17
-
- name: Run a one-line script
18
-
run: echo Hello, world!
19
-
- name: Run a multi-line script
20
-
run: |
21
-
echo Add other actions to build,
22
-
echo test, and deploy your project.
15
+
- uses: actions/checkout@v1
16
+
- name: Run a one-line script
17
+
run: echo Hello, world!
18
+
- name: Run a multi-line script
19
+
run: |
20
+
echo Add other actions to build,
21
+
echo test, and deploy your project.
23
22
```
24
23
25
24
This file is made up of a series of metadata, as well as behaviors that we wish to happen when the workflow is triggered.
26
25
27
26
Let's take a second to talk about each of the pieces that we see here:
28
27
29
28
- `name: CI`
30
-
- This is the user-defined name for the workflow. This shows up on the Actions tab so we can see which workflows, and their statuses, run on this repository.
31
-
- 
29
+
- This is the user-defined name for the workflow. This shows up on the Actions tab so we can see which workflows, and their statuses, run on this repository.
32
30
- As you can see, our's is currently named `CI`
33
31
- `on: [push]`
34
-
- This defines the **event** that will tigger a workflow on this repository. Currently we are listening for any [push event](https://developer.github.com/v3/activity/events/types/#pushevent) that happens within this repository.
32
+
- This defines the **event** that will tigger a workflow on this repository. Currently we are listening for any [push event](https://developer.github.com/v3/activity/events/types/#pushevent) that happens within this repository.
35
33
- Also note that this is an array, which means we can trigger this workflow [on more than one event](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows#about-workflow-events) if that is our intended behavior.
36
34
- `Jobs:`
37
-
- This is our first block of instructions. We are defining our first job for this workflow.
35
+
- This is our first block of instructions. We are defining our first job for this workflow.
38
36
- In this case, the job has been named `build`
39
37
- We also define the runner for the job as `runs-on: ubuntu-latest`
40
-
- Finally we define the steps for this job which can either rely on specific actions, or run commands directly. As we can see there are three steps which show a mixed usage of actions and commands.
38
+
- Finally we define the steps for this job which can either rely on specific actions, or run commands directly. As we can see there are three steps which show a mixed usage of actions and commands.
41
39
- `uses: actions/checkout@v1`
42
40
- ```
43
41
name: Run a one-line script
44
42
run: echo Hello, world!
43
+
```
45
44
- ```
46
45
name: Run a multi-line script
47
46
run: |
48
47
echo Add other actions to build,
49
48
echo test, and deploy your project.
50
-
```
49
+
```
51
50
52
51
---
53
52
53
+
📖Take a deeper dive into [workflow components](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/configuring-workflows)
54
54
📖Read more about [configuring workflows](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/configuring-workflows)
Great job adding the workflow. Adding that file to this branch is enough for GitHub Actions to begin running on your repository. The time this takes will vary based on the complexity of the workflow. While this runs I'll briefly explain the components of the workflow you just added.
3
+
Great job adding the workflow. Adding that file to this branch is enough for GitHub Actions to begin running on your repository. The time this takes will vary based on the complexity of the workflow. While this runs I'll briefly explain the components of the workflow you just added.
4
4
5
-
📖Take a deeper dive into [workflow components](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/configuring-workflows)
6
-
7
-
8
-
9
-
I'll respond when GitHub Actions finishes running the workflow. You can follow along in the [Actions tab]({{ actionsUrl }}), or by clicking **Details** on the pending status below.
5
+
If you want to inspect your running workflow you can do so by heading over to the [Actions tab]({{actionsUrl}}) of this repository.
10
6
11
7
---
12
8
@@ -21,4 +17,4 @@ If the checks don't appear or if the checks are stuck in progress, there's a few
21
17
- Refresh the page, it's possible the workflow ran and the page just hasn't been updated with that change
22
18
- Try making a commit on this branch. Our workflow is triggered with a `push` event, and committing to this branch will result in a new `push`
23
19
- Edit the workflow file on GitHub and ensure there are no red lines indicating a syntax problem
### :keyboard: Activity: Create a pull request to prepare the repository
1
+
## Configuring a workflow
2
+
3
+
Actions are enabled on your repository by default, but we still have to tell our repository to use them. We do this by creating a workflow file in our repository.
4
+
5
+
A **workflow** file can be thought of as the recipe for automating a task. They house the start to finish instructions, in the form of `jobs` and `steps`, for what should happen based on specific triggers.
6
+
7
+
Your repository can contain multiple **workflow** files that carry out a wide variety of tasks. It is important to consider this when deciding on a name for your **workflow**. The name you choose should reflect the tasks being performed.
8
+
9
+
_In our case, we will use this one **workflow** file for many things, which leads us to break this convention for teaching purposes._
10
+
11
+
📖Read more about [workflows](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/configuring-a-workflow#choosing-the-type-of-actions-for-your-workflow)
12
+
13
+
### :keyboard: Activity: Create a pull request to prepare the repository for actions
2
14
3
15
1. Create a new workflow file titled `my-workflow.yml` by using the instructions below, or [this quicklink]({{quicklink}}).
4
-
- Go to the [Actions tab]({{ actionsUrl }}).
5
-
- Choose the **Set up a workflow yourself** option, located on the top right hand corner of the screen.
6
-
- Change the name of the file from `main.yml` to `my-workflow.yml`
7
-
1. Commit the workflow to a new branch.
8
-
1. Create a pull request titled **Initial workflow**.
16
+
- Go to the [Actions tab]({{ actionsUrl }}).
17
+
- Choose the **Set up a workflow yourself** option, located on the top right hand corner of the screen.
18
+
- Change the name of the file from `main.yml` to `my-workflow.yml`.
19
+
1. Commit the workflow to a new branch named `add-initial-workflow`.
20
+
1. Create a pull request titled **Create my-workflow.yml**.
21
+
1. Supply the pull request body content and click `Create pull request`.
22
+
23
+
_It is important to place meaningful content into the body of the pull requests you create throughout this course. This repository will stay with you long after you complete the course. It is advisable that you use the body of the pull requests you create as a way to take long lived notes about thing you want to remember._
24
+
25
+
<details><summary>Suggested body content</summary>
26
+
27
+
`Workflow files are the recipe for task automation. This is where actions are placed if I want to use them for a task.`
28
+
29
+
</details>
30
+
31
+
I'll respond in the new pull request when I detect it has been created.
32
+
33
+
---
9
34
10
-
I'll respond in the new pull request when I detect it has been created.
35
+
If at any point you're expecting a response and don't see one, refresh the page.
0 commit comments