build(ci): use `vars` for docker username

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
David Karlsson 2024-06-18 16:14:18 +02:00
parent 4b089c535f
commit a92623e34e
20 changed files with 80 additions and 82 deletions

View File

@ -38,7 +38,7 @@ jobs:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata
@ -80,7 +80,7 @@ jobs:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata
@ -133,7 +133,7 @@ jobs:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata

View File

@ -68,7 +68,7 @@ jobs:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata
@ -114,7 +114,7 @@ jobs:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata

View File

@ -34,7 +34,7 @@ jobs:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
@ -67,7 +67,7 @@ jobs:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
@ -112,7 +112,7 @@ jobs:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
@ -244,7 +244,7 @@ jobs:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push

View File

@ -26,7 +26,7 @@ jobs:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry

View File

@ -54,7 +54,7 @@ jobs:
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GHCR

View File

@ -33,7 +33,7 @@ jobs:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
@ -101,7 +101,7 @@ jobs:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push by digest
@ -150,7 +150,7 @@ jobs:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Create manifest list and push
@ -286,7 +286,7 @@ jobs:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build
@ -340,7 +340,7 @@ jobs:
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Create manifest list and push

View File

@ -26,7 +26,7 @@ jobs:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry

View File

@ -35,7 +35,7 @@ jobs:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and export to Docker

View File

@ -27,7 +27,7 @@ jobs:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
@ -39,7 +39,7 @@ jobs:
- name: Update repo description
uses: peter-evans/dockerhub-description@e98e4d1628a5f3be2be7c231e50981aee98723ae # v4.0.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: user/app
```

View File

@ -66,7 +66,7 @@ jobs:
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
username: ${{ vars.DOCKER_USER }}
password: ${{ secrets.DOCKER_PAT }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

View File

@ -10,7 +10,7 @@ To follow this tutorial, you need a Docker ID and a GitHub account.
### Step one: Create the repository
Create a GitHub repository and configure the Docker Hub secrets.
Create a GitHub repository and configure the Docker Hub credentials.
1. Create a new GitHub repository using
[this template repository](https://github.com/dvdksn/clockbox/generate).
@ -20,16 +20,16 @@ Create a GitHub repository and configure the Docker Hub secrets.
2. Open the repository **Settings**, and go to **Secrets and variables** > **Actions**.
3. Create a new secret named `DOCKERHUB_USERNAME` and your Docker ID as value.
3. Create a new **Repository variable** named `DOCKER_USERNAME` and your Docker ID as value.
4. Create a new
[Personal Access Token (PAT)](/security/for-developers/access-tokens/#create-an-access-token)
for Docker Hub. You can name this token `clockboxci`.
5. Add the PAT as a second secret in your GitHub repository, with the name
5. Add the PAT as a **Repository secret** in your GitHub repository, with the name
`DOCKERHUB_TOKEN`.
With your repository created, and secrets configured, you're now ready for
With your repository created, and credentials configured, you're now ready for
action!
### Step two: Set up the workflow
@ -81,7 +81,7 @@ jobs:
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Set up Docker Buildx
@ -91,7 +91,7 @@ jobs:
uses: docker/build-push-action@v6
with:
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/clockbox:latest
tags: ${{ vars.DOCKERHUB_USERNAME }}/clockbox:latest
```
@ -130,7 +130,7 @@ jobs:
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Set up Docker Buildx
@ -140,7 +140,7 @@ jobs:
uses: docker/build-push-action@v6
with:
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/clockbox:latest
tags: ${{ vars.DOCKERHUB_USERNAME }}/clockbox:latest
```

View File

@ -18,18 +18,18 @@ In this section, you'll learn how to set up and use GitHub Actions to build and
## Step one: Create the repository
Create a GitHub repository, configure the Docker Hub secrets, and push your source code.
Create a GitHub repository, configure the Docker Hub credentials, and push your source code.
1. [Create a new repository](https://github.com/new) on GitHub.
2. Open the repository **Settings**, and go to **Secrets and variables** >
**Actions**.
3. Create a new **Repository secrets** named `DOCKER_USERNAME` and your Docker ID as value.
3. Create a new **Repository variable** named `DOCKER_USERNAME` and your Docker ID as value.
4. Create a new [Personal Access Token (PAT)](../../security/for-developers/access-tokens.md/#create-an-access-token) for Docker Hub. You can name this token `docker-tutorial`. Make sure access permissions include Read and Write.
5. Add the PAT as a second **Repository secrets** in your GitHub repository, with the name
5. Add the PAT as a **Repository secret** in your GitHub repository, with the name
`DOCKERHUB_TOKEN`.
6. In your local repository on your machine, run the following command to change
@ -79,7 +79,7 @@ to Docker Hub.
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Set up Docker Buildx
@ -90,7 +90,7 @@ to Docker Hub.
with:
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:latest
tags: ${{ vars.DOCKER_USERNAME }}/${{ github.event.repository.name }}:latest
```
For more information about the YAML syntax for `docker/build-push-action`,

View File

@ -18,18 +18,18 @@ In this section, you'll learn how to set up and use GitHub Actions to build and
## Step one: Create the repository
Create a GitHub repository, configure the Docker Hub secrets, and push your source code.
Create a GitHub repository, configure the Docker Hub credentials, and push your source code.
1. [Create a new repository](https://github.com/new) on GitHub.
2. Open the repository **Settings**, and go to **Secrets and variables** >
**Actions**.
3. Create a new secret named `DOCKER_USERNAME` and your Docker ID as value.
3. Create a new **Repository variable** named `DOCKER_USERNAME` and your Docker ID as value.
4. Create a new [Personal Access Token (PAT)](../../security/for-developers/access-tokens.md/#create-an-access-token) for Docker Hub. You can name this token `tutorial-docker`. Make sure access permissions include Read and Write.
4. Create a new [Personal Access Token (PAT)](../../security/for-developers/access-tokens.md/#create-an-access-token) for Docker Hub. You can name this token `docker-tutorial`. Make sure access permissions include Read and Write.
5. Add the PAT as a second secret in your GitHub repository, with the name
5. Add the PAT as a **Repository secret** in your GitHub repository, with the name
`DOCKERHUB_TOKEN`.
6. In your local repository on your machine, run the following command to change
@ -87,7 +87,7 @@ to Docker Hub.
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Set up Docker Buildx
@ -105,7 +105,7 @@ to Docker Hub.
platforms: linux/amd64,linux/arm64
push: true
target: final
tags: ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:latest
tags: ${{ vars.DOCKER_USERNAME }}/${{ github.event.repository.name }}:latest
```
For more information about the YAML syntax for `docker/build-push-action`,

View File

@ -18,18 +18,18 @@ In this section, you'll learn how to set up and use GitHub Actions to build and
## Step one: Create the repository
Create a GitHub repository, configure the Docker Hub secrets, and push your source code.
Create a GitHub repository, configure the Docker Hub credentials, and push your source code.
1. [Create a new repository](https://github.com/new) on GitHub.
2. Open the repository **Settings**, and go to **Secrets and variables** >
**Actions**.
3. Create a new **Repository secrets** named `DOCKER_USERNAME` and your Docker ID as value.
3. Create a new **Repository variable** named `DOCKER_USERNAME` and your Docker ID as value.
4. Create a new [Personal Access Token (PAT)](../../security/for-developers/access-tokens.md/#create-an-access-token) for Docker Hub. You can name this token `docker-tutorial`. Make sure access permissions include Read and Write.
5. Add the PAT as a second **Repository secrets** in your GitHub repository, with the name
5. Add the PAT as a **Repository secret** in your GitHub repository, with the name
`DOCKERHUB_TOKEN`.
6. In your local repository on your machine, run the following command to change
@ -79,7 +79,7 @@ to Docker Hub.
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Set up Docker Buildx
@ -90,7 +90,7 @@ to Docker Hub.
with:
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:latest
tags: ${{ vars.DOCKER_USERNAME }}/${{ github.event.repository.name }}:latest
```
For more information about the YAML syntax for `docker/build-push-action`,

View File

@ -18,18 +18,18 @@ In this section, you'll learn how to set up and use GitHub Actions to build and
## Step one: Create the repository
Create a GitHub repository, configure the Docker Hub secrets, and push your source code.
Create a GitHub repository, configure the Docker Hub credentials, and push your source code.
1. [Create a new repository](https://github.com/new) on GitHub.
2. Open the repository **Settings**, and go to **Secrets and variables** >
**Actions**.
3. Create a new secret named `DOCKER_USERNAME` and your Docker ID as value.
3. Create a new **Repository variable** named `DOCKER_USERNAME` and your Docker ID as value.
4. Create a new [Personal Access Token (PAT)](../../security/for-developers/access-tokens.md/#create-an-access-token) for Docker Hub. You can name this token `docker-tutorial`. Make sure access permissions include Read and Write.
5. Add the PAT as a second secret in your GitHub repository, with the name
5. Add the PAT as a **Repository secret** in your GitHub repository, with the name
`DOCKERHUB_TOKEN`.
6. In your local repository on your machine, run the following command to change
@ -82,7 +82,7 @@ to Docker Hub.
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Set up Docker Buildx
@ -100,7 +100,7 @@ to Docker Hub.
platforms: linux/amd64,linux/arm64
push: true
target: final
tags: ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:latest
tags: ${{ vars.DOCKER_USERNAME }}/${{ github.event.repository.name }}:latest
```
For more information about the YAML syntax for `docker/build-push-action`,

View File

@ -18,20 +18,18 @@ In this section, you'll learn how to set up and use GitHub Actions to build and
## Step one: Create the repository
Create a GitHub repository, configure the Docker Hub secrets, and push your source code.
Create a GitHub repository, configure the Docker Hub credentials, and push your source code.
1. [Create a new repository](https://github.com/new) on GitHub.
2. Open the repository **Settings**, and go to **Secrets and variables** >
**Actions**.
3. Create a new secret named `DOCKER_USERNAME` and your Docker ID as value.
3. Create a new **Repository variable** named `DOCKER_USERNAME` and your Docker ID as value.
4. Create a new [Personal Access Token
(PAT)](/security/for-developers/access-tokens/#create-an-access-token) for Docker Hub. You
can name this token `node-docker`. Make sure access permissions include Read and Write.
4. Create a new [Personal Access Token (PAT)](../../security/for-developers/access-tokens.md/#create-an-access-token) for Docker Hub. You can name this token `docker-tutorial`. Make sure access permissions include Read and Write.
5. Add the PAT as a second **Repository secrets** in your GitHub repository, with the name
5. Add the PAT as a **Repository secret** in your GitHub repository, with the name
`DOCKERHUB_TOKEN`.
6. In your local repository on your machine, run the following command to change
@ -81,7 +79,7 @@ to Docker Hub.
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Set up Docker Buildx
@ -99,7 +97,7 @@ to Docker Hub.
platforms: linux/amd64,linux/arm64/v8
push: true
target: prod
tags: ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:latest
tags: ${{ vars.DOCKER_USERNAME }}/${{ github.event.repository.name }}:latest
```
For more information about the YAML syntax for `docker/build-push-action`,

View File

@ -18,18 +18,18 @@ In this section, you'll learn how to set up and use GitHub Actions to build and
## Step one: Create the repository
Create a GitHub repository, configure the Docker Hub secrets, and push your source code.
Create a GitHub repository, configure the Docker Hub credentials, and push your source code.
1. [Create a new repository](https://github.com/new) on GitHub.
2. Open the repository **Settings**, and go to **Secrets and variables** >
**Actions**.
3. Create a new secret named `DOCKER_USERNAME` and your Docker ID as value.
3. Create a new **Repository variable** named `DOCKER_USERNAME` and your Docker ID as value.
4. Create a new [Personal Access Token (PAT)](../../security/for-developers/access-tokens.md/#create-an-access-token) for Docker Hub. You can name this token `tutorial-docker`. Make sure access permissions include Read and Write.
4. Create a new [Personal Access Token (PAT)](../../security/for-developers/access-tokens.md/#create-an-access-token) for Docker Hub. You can name this token `docker-tutorial`. Make sure access permissions include Read and Write.
5. Add the PAT as a second secret in your GitHub repository, with the name
5. Add the PAT as a **Repository secret** in your GitHub repository, with the name
`DOCKERHUB_TOKEN`.
6. In your local repository on your machine, run the following command to change
@ -87,7 +87,7 @@ to Docker Hub.
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Set up Docker Buildx
@ -105,7 +105,7 @@ to Docker Hub.
platforms: linux/amd64,linux/arm64
push: true
target: final
tags: ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:latest
tags: ${{ vars.DOCKER_USERNAME }}/${{ github.event.repository.name }}:latest
```
For more information about the YAML syntax for `docker/build-push-action`,

View File

@ -18,18 +18,18 @@ In this section, you'll learn how to set up and use GitHub Actions to build and
## Step one: Create the repository
Create a GitHub repository, configure the Docker Hub secrets, and push your source code.
Create a GitHub repository, configure the Docker Hub credentials, and push your source code.
1. [Create a new repository](https://github.com/new) on GitHub.
2. Open the repository **Settings**, and go to **Secrets and variables** >
**Actions**.
3. Create a new secret named `DOCKER_USERNAME` and your Docker ID as value.
3. Create a new **Repository variable** named `DOCKER_USERNAME` and your Docker ID as value.
4. Create a new [Personal Access Token (PAT)](../../security/for-developers/access-tokens.md/#create-an-access-token) for Docker Hub. You can name this token `python-docker`. Make sure access permissions include Read and Write.
4. Create a new [Personal Access Token (PAT)](../../security/for-developers/access-tokens.md/#create-an-access-token) for Docker Hub. You can name this token `docker-tutorial`. Make sure access permissions include Read and Write.
5. Add the PAT as a second secret in your GitHub repository, with the name
5. Add the PAT as a **Repository secret** in your GitHub repository, with the name
`DOCKERHUB_TOKEN`.
6. In your local repository on your machine, run the following command to change
@ -79,7 +79,7 @@ to Docker Hub.
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Set up Docker Buildx
@ -90,7 +90,7 @@ to Docker Hub.
with:
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:latest
tags: ${{ vars.DOCKER_USERNAME }}/${{ github.event.repository.name }}:latest
```
For more information about the YAML syntax for `docker/build-push-action`,

View File

@ -18,18 +18,18 @@ In this section, you'll learn how to set up and use GitHub Actions to build and
## Step one: Create the repository
Create a GitHub repository, configure the Docker Hub secrets, and push your source code.
Create a GitHub repository, configure the Docker Hub credentials, and push your source code.
1. [Create a new repository](https://github.com/new) on GitHub.
2. Open the repository **Settings**, and go to **Secrets and variables** >
**Actions**.
3. Create a new secret named `DOCKER_USERNAME` and your Docker ID as value.
3. Create a new **Repository variable** named `DOCKER_USERNAME` and your Docker ID as value.
4. Create a new [Personal Access Token (PAT)](../../security/for-developers/access-tokens.md/#create-an-access-token) for Docker Hub. You can name this token `r-docker`.
4. Create a new [Personal Access Token (PAT)](../../security/for-developers/access-tokens.md/#create-an-access-token) for Docker Hub. You can name this token `docker-tutorial`. Make sure access permissions include Read and Write.
5. Add the PAT as a second secret in your GitHub repository, with the name
5. Add the PAT as a **Repository secret** in your GitHub repository, with the name
`DOCKERHUB_TOKEN`.
6. In your local repository on your machine, run the following command to change
@ -79,7 +79,7 @@ to Docker Hub.
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Set up Docker Buildx
@ -90,7 +90,7 @@ to Docker Hub.
with:
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:latest
tags: ${{ vars.DOCKER_USERNAME }}/${{ github.event.repository.name }}:latest
```
For more information about the YAML syntax for `docker/build-push-action`,

View File

@ -18,18 +18,18 @@ In this section, you'll learn how to set up and use GitHub Actions to build and
## Step one: Create the repository
Create a GitHub repository, configure the Docker Hub secrets, and push your source code.
Create a GitHub repository, configure the Docker Hub credentials, and push your source code.
1. [Create a new repository](https://github.com/new) on GitHub.
2. Open the repository **Settings**, and go to **Secrets and variables** >
**Actions**.
3. Create a new secret named `DOCKER_USERNAME` and your Docker ID as value.
3. Create a new **Repository variable** named `DOCKER_USERNAME` and your Docker ID as value.
4. Create a new [Personal Access Token (PAT)](../../security/for-developers/access-tokens.md/#create-an-access-token) for Docker Hub. You can name this token `rust-docker`. Make sure access permissions include Read and Write.
4. Create a new [Personal Access Token (PAT)](../../security/for-developers/access-tokens.md/#create-an-access-token) for Docker Hub. You can name this token `docker-tutorial`. Make sure access permissions include Read and Write.
5. Add the PAT as a second secret in your GitHub repository, with the name
5. Add the PAT as a **Repository secret** in your GitHub repository, with the name
`DOCKERHUB_TOKEN`.
6. In your local repository on your machine, run the following command to change
@ -79,7 +79,7 @@ to Docker Hub.
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Set up Docker Buildx
@ -89,7 +89,7 @@ to Docker Hub.
uses: docker/build-push-action@v6
with:
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:latest
tags: ${{ vars.DOCKER_USERNAME }}/${{ github.event.repository.name }}:latest
```
For more information about the YAML syntax for `docker/build-push-action`,