This course helps you create a simple GitHub Action and use that action in a workflow.
What are GitHub Actions?
GitHub Actions are a flexible way to automate nearly every aspect of your team's software workflow. Here are just a few of the ways teams are using GitHub Actions:
Automated testing (CI)
Continuous delivery and deployment
Responding to workflow triggers using issues, @ mentions, labels, and more
Triggering code reviews
Managing branches
Triaging issues and pull requests
The sky is truly the limit with GitHub Actions.
The best part, these workflows are stored as code in your repository and easily shared and reused across teams.
In this course you will work with issues and pull requests, as well as edit files. If these things are not familiar to you, we recommend you take the Introduction to GitHub course, first!
Originally created by @github-learning-lab[bot] on GitHub (Jun 7, 2020).
Original GitHub issue: https://github.com/bendtherules/hello-github-actions/issues/1
# Welcome
This course helps you create a simple GitHub Action and use that action in a workflow.
## What are GitHub Actions?
GitHub Actions are a flexible way to automate nearly every aspect of your team's software workflow. Here are just a few of the ways teams are using GitHub Actions:
- Automated testing (CI)
- Continuous delivery and deployment
- Responding to workflow triggers using issues, @ mentions, labels, and more
- Triggering code reviews
- Managing branches
- Triaging issues and pull requests
The sky is truly the limit with GitHub Actions.
The best part, these workflows are stored as code in your repository and easily shared and reused across teams.
To learn even more, check out the [GitHub Actions feature page](https://github.com/features/actions), or the [GitHub Actions documentation](https://help.github.com/en/actions).
### Before you begin
In this course you will work with issues and pull requests, as well as edit files. If these things are not familiar to you, we recommend you take the [Introduction to GitHub](https://lab.github.com/githubtraining/introduction-to-github) course, first!
@github-learning-lab[bot] commented on GitHub (Jun 7, 2020):
Actions and Workflows
There are two components to using GitHub Actions that we'll cover:
the action itself
a workflow that uses action(s)
A workflow can contain many actions. Each action has its own purpose. We'll put the files relating to the action in their own directories.
Types of Actions
Actions come in two types: container actions and JavaScript actions.
Docker container actions allow the environment to be packaged with the GitHub Actions code and can only execute in the GitHub-Hosted Linux environment.
JavaScript actions decouple the GitHub Actions code from the environment allowing faster execution but accepting greater dependency management responsibility.
Step 1: Add a Dockerfile
Our action will use a Docker container so it will require a Dockerfile. Let's add it now. We won't discuss what each line means in detail, but the important thing to know is that the action will be executed in an environment defined by this file.
⌨️ Activity: Create a Dockerfile and open a pull request
Create a new branch. Branches should be named intentionally, so a good name for this branch could be first-action.
On the new branch, create a directory: action-a. Note: If you're working on GitHub.com, you can create a directory and a file at the same time by naming the file action-a/Dockerfile.
In the action-a directory, create a file titled Dockerfile.
If you're working locally, you will also need stage your file and to push the branch to GitHub.
Open a pull request with your new branch against master
I'll respond in your new pull request with next steps.
<!-- gh-comment-id:640244430 -->
@github-learning-lab[bot] commented on GitHub (Jun 7, 2020):
### Actions and Workflows
There are two components to using GitHub Actions that we'll cover:
- the **action** itself
- a **workflow** that uses action(s)
A workflow can contain many actions. Each action has its own purpose. We'll put the files relating to the action in their own directories.
### Types of Actions
Actions come in two types: **container actions** and **JavaScript actions**.
Docker **container actions** allow the environment to be packaged with the GitHub Actions code and can only execute in the GitHub-Hosted Linux environment.
**JavaScript actions** decouple the GitHub Actions code from the environment allowing faster execution but accepting greater dependency management responsibility.
<!--
UNCOMMENT WHEN THESE TWO COURSE GO LIVE AND ADD PROPER LINK DETAILS
📖 To learn more about creating each type of action, refer to the related learning lab course:
- [Writing JavaScript Actions]()
- [Writing Docker Container Actions]() -->
## Step 1: Add a `Dockerfile`
Our action will use a Docker container so it will require a `Dockerfile`. Let's add it now. We won't discuss what each line means in detail, but the important thing to know is that the action will be executed in an environment defined by this file.
### :keyboard: Activity: Create a `Dockerfile` and open a pull request
1. Create a file titled `action-a/Dockerfile` by [using this quick link](https://github.com/bendtherules/hello-github-actions/new/master?filename=action-a/Dockerfile) or manually:
- Create a new branch. _Branches should be named intentionally, so a good name for this branch could be `first-action`_.
- On the new branch, create a directory: `action-a`. _Note:_ If you're working on GitHub.com, you can create a directory and a file at the same time by naming the file `action-a/Dockerfile`.
- In the `action-a` directory, create a file titled `Dockerfile`.
1. Fill the `Dockerfile` with the content below:
```Dockerfile
FROM debian:9.5-slim
ADD entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
```
1. Commit your file
- If you're working locally, you will also need stage your file and to push the branch to GitHub.
1. Open a pull request with your new branch against `master`
<hr>
<h3 align="center">I'll respond in your new pull request with next steps.</h3>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @github-learning-lab[bot] on GitHub (Jun 7, 2020).
Original GitHub issue: https://github.com/bendtherules/hello-github-actions/issues/1
Welcome
This course helps you create a simple GitHub Action and use that action in a workflow.
What are GitHub Actions?
GitHub Actions are a flexible way to automate nearly every aspect of your team's software workflow. Here are just a few of the ways teams are using GitHub Actions:
The sky is truly the limit with GitHub Actions.
The best part, these workflows are stored as code in your repository and easily shared and reused across teams.
To learn even more, check out the GitHub Actions feature page, or the GitHub Actions documentation.
Before you begin
In this course you will work with issues and pull requests, as well as edit files. If these things are not familiar to you, we recommend you take the Introduction to GitHub course, first!
@github-learning-lab[bot] commented on GitHub (Jun 7, 2020):
Actions and Workflows
There are two components to using GitHub Actions that we'll cover:
A workflow can contain many actions. Each action has its own purpose. We'll put the files relating to the action in their own directories.
Types of Actions
Actions come in two types: container actions and JavaScript actions.
Docker container actions allow the environment to be packaged with the GitHub Actions code and can only execute in the GitHub-Hosted Linux environment.
JavaScript actions decouple the GitHub Actions code from the environment allowing faster execution but accepting greater dependency management responsibility.
Step 1: Add a
DockerfileOur action will use a Docker container so it will require a
Dockerfile. Let's add it now. We won't discuss what each line means in detail, but the important thing to know is that the action will be executed in an environment defined by this file.⌨️ Activity: Create a
Dockerfileand open a pull requestCreate a file titled
action-a/Dockerfileby using this quick link or manually:first-action.action-a. Note: If you're working on GitHub.com, you can create a directory and a file at the same time by naming the fileaction-a/Dockerfile.action-adirectory, create a file titledDockerfile.Fill the
Dockerfilewith the content below:Commit your file
Open a pull request with your new branch against
masterI'll respond in your new pull request with next steps.