VooooooZ / hello-world-actions

https://lab.github.com/githubtraining/a-hello-world-workflow
0 stars 0 forks source link

Welcome #1

Open github-learning-lab[bot] opened 5 years ago

github-learning-lab[bot] commented 5 years ago

Welcome

This is a companion course to the Developer Guide: Creating a new workflow. For the most complete information, see the documentation.

There are parts of this course which will need to be completed locally, using the command line. During those steps, more instructions are provided in case you're used to working with the GitHub.com interface directly.

Note: GitHub Actions is currently available in public beta, which means you should avoid using it for high-value workflows and content during this beta period.

This course will only work for members of the GitHub Actions public beta.

Features and requirements may change at any time during this period. You can request to join the public beta on the GitHub Actions page. If you're participating in the beta, please contact support if you have any questions.

github-learning-lab[bot] commented 5 years ago

Actions and Workflows

There are two components to using GitHub Actions that we'll cover:

A workflow can contain many actions, but each action has its own purpose. So, we'll put the files relating to the action in their own directory.

Step 1: Creating a Dockerfile

Every GitHub Action runs in a Docker container and requires 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 new branch
    • Branches should be named intentionally, so a good name for this branch could be first-action
  2. 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
  3. In the action-a directory, create a file titled Dockerfile
  4. Fill the Dockerfile with the content below:

    FROM debian:9.5-slim
    
    LABEL "com.github.actions.name"="Hello World"
    LABEL "com.github.actions.description"="Write arguments to the standard output"
    LABEL "com.github.actions.icon"="mic"
    LABEL "com.github.actions.color"="purple"
    
    LABEL "repository"="http://github.com/octocat/hello-world"
    LABEL "homepage"="http://github.com/actions"
    LABEL "maintainer"="Octocat <octocat@github.com>"
    
    ADD entrypoint.sh /entrypoint.sh
    ENTRYPOINT ["/entrypoint.sh"]
  5. Stage and commit your file
    • If you're working locally, you will also need to push the branch to GitHub
  6. Open a pull request with your new branch against master

I'll respond in your new pull request with next steps.