Skip to content

Create Dockerfile#2

Open
dennym wants to merge 2 commits intomasterfrom
implement-first-action
Open

Create Dockerfile#2
dennym wants to merge 2 commits intomasterfrom
implement-first-action

Conversation

@dennym
Copy link
Copy Markdown
Owner

@dennym dennym commented Aug 13, 2019

No description provided.

@github-learning-lab
Copy link
Copy Markdown

Nice work, you committed a Dockerfile. You'll notice at the end of the Dockerfile, we refer to an entrypoint script.

ENTRYPOINT ["/entrypoint.sh"]

The entrypoint.sh script will be run in Docker, and it will define what the action is really going to be doing.

Step 2: Add the action's script

An entrypoint script must exist in our repository so that Docker has something to execute.

⌨️ Activity: Add an entrypoint script and commit it to your branch

  1. As a part of this branch and pull request, create a file in the ./action-a/ directory titled entrypoint.sh
  2. Add the following content to the entrypoint.sh file:
    #!/bin/sh -l
    
    sh -c "echo Hello world my name is $MY_NAME"
  3. Working locally, ensure the script is executable:
    chmod +x action-a/entrypoint.sh
  4. Stage and commit the changes
  5. Push the changes to GitHub

I'll respond when I detect a new commit on this branch.

@github-learning-lab
Copy link
Copy Markdown

Almost there! Your script is present, but it's not executable.

⌨️ Activity: Make your script executable

Assuming you've only worked on the web UI, and not locally until now, follow these instructions to make the script executable:

  1. Open your favorite shell
  2. Clone the repository:
    git clone https://github.com/dennym/hello-github-actions.git
    cd hello-github-actions
  3. Checkout to the branch in this pull request:
    git checkout implement-first-action
  4. Make the script executable:
    chmod +x action-a/entrypoint.sh
  5. Stage and commit the change:
    git add action-a/entrypoint.sh
    git commit -m "make entrypoint script executable"
  6. Push the branch to GitHub:
    git push

When I detect your new commit, I'll respond in this pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant