AravindaSB / github-actions-for-packages

https://lab.github.com/githubtraining/github-actions:-publish-to-github-packages
MIT License
0 stars 0 forks source link

Add a Dockerfile #3

Closed github-learning-lab[bot] closed 3 years ago

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

Creating a Dockerfile 🐳

You may have noticed that your workflow didn't run as expected. That's because we don't have a Dockerfile in our repository yet!

We will add a Dockerfile in this pull request. I'll leave a comment with instructions to help you. 😄

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

Dockerfile 🐳

The Dockerfile contains a set of instructions that get stored in a Docker Image.

We will use a very simple Dockerfile. If you'd like, you can learn more about Dockerfiles.

Step 3: Add a Dockerfile image

:keyboard: Activity: Edit the Dockerfile to include the proper image

  1. Edit the Dockerfile located on the add-dockerfile branch in the root of the repository
  2. Paste the following contents inside of the Docker file:
FROM nginx:1.17
COPY . /usr/share/nginx/html
  1. Commit your changes to the add-dockerfile branch
github-learning-lab[bot] commented 3 years ago

Now things are running!

Whoa, now things are running! This may take a few minutes.

After committing the Dockerfile, the repository had the components it needed to start the CD workflow.

This might take a tiny amount of time, so grab your popcorn 🍿 and wait. I'll respond one your pipeline has finished running, until then... sit tight!

You can click the Actions tab to view your workflow in progress. Make sure you come back to this pull request.

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

You did it!

It looks like your workflow run was successful. Awesome!

You now have a Docker image stored in the GitHub Packages.

screenshot of repository navigation highlighting the "1 package" button

You may need to switch to the main branch to see your package count increase.

screenshot of the packages built as seen at the top of the `code` tab

You should now see a package named tic-tac-toe. 🎉


I'll go ahead and merge this pull request. I'll give you the next steps in the next issue.