You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/guides/ruby/configure-github-actions.md
+38-40Lines changed: 38 additions & 40 deletions
Original file line number
Diff line number
Diff line change
@@ -34,68 +34,66 @@ In this section, you'll learn how to set up and use GitHub Actions to build your
34
34
1. Define the GitHub Actions workflow.
35
35
2. Run the workflow.
36
36
37
-
## 1. Set up the workflow
37
+
## 1. Define the GitHub Actions workflow
38
38
39
-
Set up your GitHub Actions workflow for building, testing, and pushing the image
40
-
to Docker Hub.
39
+
You can create a GitHub Actions workflow by creating a YAML file in the `.github/workflows/` directory of your repository. To do this use your favorite text editor or the GitHub web interface. The following steps show you how to create a workflow file using the GitHub web interface.
40
+
41
+
If you prefer to use the GitHub web interface, follow these steps:
41
42
42
43
1. Go to your repository on GitHub and then select the **Actions** tab.
43
44
44
45
2. Select **set up a workflow yourself**.
45
46
46
47
This takes you to a page for creating a new GitHub actions workflow file in
47
-
your repository, under `.github/workflows/main.yml` by default.
48
+
your repository. By default, the file is created under `.github/workflows/main.yml`, let's change it name to `build.yml`.
48
49
49
-
3. In the editor window, copy and paste the following YAML configuration.
50
+
If you prefer to use your text editor, create a new file named `build.yml` in the `.github/workflows/` directory of your repository.
Each GitHub Actions workflow includes one or several jobs. Each job consists of steps. Each step can either run a set of commands or use already [existing actions](https://github.com/marketplace?type=actions). The action above has three steps:
83
83
84
-
Save the workflow file and run the job.
84
+
1. [**Login to Docker Hub**](https://github.com/docker/login-action): Action logs in to Docker Hub using the Docker ID and Personal Access Token (PAT) you created earlier.
85
85
86
-
1. Select **Commit changes...** and push the changes to the `main` branch.
86
+
2. [**Set up Docker Buildx**](https://github.com/docker/setup-buildx-action): Action sets up Docker [Buildx](https://github.com/docker/buildx), a CLI plugin that extends the capabilities of the Docker CLI.
87
87
88
-
After pushing the commit, the workflow starts automatically.
88
+
3. [**Build and push**](https://github.com/docker/build-push-action): Action builds and pushes the Docker image to Docker Hub. The `tags` parameter specifies the image name and tag. The `latest` tag is used in this example.
89
89
90
-
2. Go to the **Actions** tab. It displays the workflow.
90
+
## 2. Run the workflow
91
91
92
-
Selecting the workflow shows you the breakdown of all the steps.
92
+
Let's commit the changes, push them to the `main` branch. In the workflow above, the trigger is set to `push` events on the `main` branch. This means that the workflow will run every time you push changes to the `main` branch. You can find more information about the workflow triggers [here](https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows).
93
93
94
-
3. When the workflow is complete, go to your
95
-
[repositories on Docker Hub](https://hub.docker.com/repositories).
94
+
Go to the **Actions** tab of you GitHub repository. It displays the workflow. Selecting the workflow shows you the breakdown of all the steps.
96
95
97
-
If you see the new repository in that list, it means the GitHub Actions
98
-
successfully pushed the image to Docker Hub.
96
+
When the workflow is complete, go to your [repositories on Docker Hub](https://hub.docker.com/repositories). If you see the new repository in that list, it means the GitHub Actions workflow successfully pushed the image to Docker Hub.
0 commit comments