Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

Latest commit

 

History

History
49 lines (33 loc) · 2.23 KB

00.1_first-steps.md

File metadata and controls

49 lines (33 loc) · 2.23 KB

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

  1. Create a file titled action-a/Dockerfile by [using this quick link]({{ dockerfileUrl }}) 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.
  2. Fill the Dockerfile with the content below:

    FROM debian:9.5-slim
    
    ADD entrypoint.sh /entrypoint.sh
    RUN chmod +x /entrypoint.sh
    ENTRYPOINT ["/entrypoint.sh"]
  3. Commit your file

    • If you're working locally, you will also need stage your file and to push the branch to GitHub.
  4. Open a pull request with your new branch against main


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