From a92623e34ed1b3aa8998f2553680038314aea91c Mon Sep 17 00:00:00 2001 From: David Karlsson <35727626+dvdksn@users.noreply.github.com> Date: Tue, 18 Jun 2024 16:14:18 +0200 Subject: [PATCH] build(ci): use `vars` for docker username Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com> --- content/build/ci/github-actions/annotations.md | 6 +++--- content/build/ci/github-actions/attestations.md | 4 ++-- content/build/ci/github-actions/cache.md | 8 ++++---- .../ci/github-actions/copy-image-registries.md | 2 +- .../ci/github-actions/manage-tags-labels.md | 2 +- .../build/ci/github-actions/multi-platform.md | 10 +++++----- .../ci/github-actions/push-multi-registries.md | 2 +- .../build/ci/github-actions/test-before-push.md | 2 +- .../ci/github-actions/update-dockerhub-desc.md | 4 ++-- content/build/cloud/ci.md | 2 +- content/includes/gha-tutorial.md | 16 ++++++++-------- content/language/cpp/configure-ci-cd.md | 10 +++++----- content/language/dotnet/configure-ci-cd.md | 12 ++++++------ content/language/golang/configure-ci-cd.md | 10 +++++----- content/language/java/configure-ci-cd.md | 10 +++++----- content/language/nodejs/configure-ci-cd.md | 14 ++++++-------- content/language/php/configure-ci-cd.md | 12 ++++++------ content/language/python/configure-ci-cd.md | 12 ++++++------ content/language/r/configure-ci-cd.md | 12 ++++++------ content/language/rust/configure-ci-cd.md | 12 ++++++------ 20 files changed, 80 insertions(+), 82 deletions(-) diff --git a/content/build/ci/github-actions/annotations.md b/content/build/ci/github-actions/annotations.md index 3759dc59f6..6dd58ef195 100644 --- a/content/build/ci/github-actions/annotations.md +++ b/content/build/ci/github-actions/annotations.md @@ -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 diff --git a/content/build/ci/github-actions/attestations.md b/content/build/ci/github-actions/attestations.md index 6976214f0d..3e619ea907 100644 --- a/content/build/ci/github-actions/attestations.md +++ b/content/build/ci/github-actions/attestations.md @@ -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 diff --git a/content/build/ci/github-actions/cache.md b/content/build/ci/github-actions/cache.md index 8bfe15e120..434b269f70 100644 --- a/content/build/ci/github-actions/cache.md +++ b/content/build/ci/github-actions/cache.md @@ -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 diff --git a/content/build/ci/github-actions/copy-image-registries.md b/content/build/ci/github-actions/copy-image-registries.md index 70eb28ef0d..48f4970e96 100644 --- a/content/build/ci/github-actions/copy-image-registries.md +++ b/content/build/ci/github-actions/copy-image-registries.md @@ -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 diff --git a/content/build/ci/github-actions/manage-tags-labels.md b/content/build/ci/github-actions/manage-tags-labels.md index 249a75a206..8b90becef6 100644 --- a/content/build/ci/github-actions/manage-tags-labels.md +++ b/content/build/ci/github-actions/manage-tags-labels.md @@ -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 diff --git a/content/build/ci/github-actions/multi-platform.md b/content/build/ci/github-actions/multi-platform.md index 032f5b8976..818e966775 100644 --- a/content/build/ci/github-actions/multi-platform.md +++ b/content/build/ci/github-actions/multi-platform.md @@ -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 diff --git a/content/build/ci/github-actions/push-multi-registries.md b/content/build/ci/github-actions/push-multi-registries.md index 8b3538863f..860eb64fe2 100644 --- a/content/build/ci/github-actions/push-multi-registries.md +++ b/content/build/ci/github-actions/push-multi-registries.md @@ -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 diff --git a/content/build/ci/github-actions/test-before-push.md b/content/build/ci/github-actions/test-before-push.md index 6cad0bd607..87bcb7ff31 100644 --- a/content/build/ci/github-actions/test-before-push.md +++ b/content/build/ci/github-actions/test-before-push.md @@ -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 diff --git a/content/build/ci/github-actions/update-dockerhub-desc.md b/content/build/ci/github-actions/update-dockerhub-desc.md index c35e739f5c..8ee4e36126 100644 --- a/content/build/ci/github-actions/update-dockerhub-desc.md +++ b/content/build/ci/github-actions/update-dockerhub-desc.md @@ -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 ``` diff --git a/content/build/cloud/ci.md b/content/build/cloud/ci.md index e71cae3130..733320c3f1 100644 --- a/content/build/cloud/ci.md +++ b/content/build/cloud/ci.md @@ -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 diff --git a/content/includes/gha-tutorial.md b/content/includes/gha-tutorial.md index b33f143ed4..f4dc92b70c 100644 --- a/content/includes/gha-tutorial.md +++ b/content/includes/gha-tutorial.md @@ -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 ``` diff --git a/content/language/cpp/configure-ci-cd.md b/content/language/cpp/configure-ci-cd.md index ff2849db54..7c65cfbe3b 100644 --- a/content/language/cpp/configure-ci-cd.md +++ b/content/language/cpp/configure-ci-cd.md @@ -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`, diff --git a/content/language/dotnet/configure-ci-cd.md b/content/language/dotnet/configure-ci-cd.md index 99928a7cca..41f49898cc 100644 --- a/content/language/dotnet/configure-ci-cd.md +++ b/content/language/dotnet/configure-ci-cd.md @@ -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`, diff --git a/content/language/golang/configure-ci-cd.md b/content/language/golang/configure-ci-cd.md index 2f7a466233..5198b9a97b 100644 --- a/content/language/golang/configure-ci-cd.md +++ b/content/language/golang/configure-ci-cd.md @@ -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`, diff --git a/content/language/java/configure-ci-cd.md b/content/language/java/configure-ci-cd.md index 782a0778c9..73572fbcb2 100644 --- a/content/language/java/configure-ci-cd.md +++ b/content/language/java/configure-ci-cd.md @@ -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`, diff --git a/content/language/nodejs/configure-ci-cd.md b/content/language/nodejs/configure-ci-cd.md index dbc8c476b2..5c5abcd186 100644 --- a/content/language/nodejs/configure-ci-cd.md +++ b/content/language/nodejs/configure-ci-cd.md @@ -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`, diff --git a/content/language/php/configure-ci-cd.md b/content/language/php/configure-ci-cd.md index de05972bf8..fd3e97088d 100644 --- a/content/language/php/configure-ci-cd.md +++ b/content/language/php/configure-ci-cd.md @@ -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`, diff --git a/content/language/python/configure-ci-cd.md b/content/language/python/configure-ci-cd.md index 70e8a87062..a8e3d93825 100644 --- a/content/language/python/configure-ci-cd.md +++ b/content/language/python/configure-ci-cd.md @@ -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`, diff --git a/content/language/r/configure-ci-cd.md b/content/language/r/configure-ci-cd.md index 6b5e0e4956..0c3fd91910 100644 --- a/content/language/r/configure-ci-cd.md +++ b/content/language/r/configure-ci-cd.md @@ -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`, diff --git a/content/language/rust/configure-ci-cd.md b/content/language/rust/configure-ci-cd.md index 0dfc611742..f1dc557931 100644 --- a/content/language/rust/configure-ci-cd.md +++ b/content/language/rust/configure-ci-cd.md @@ -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`,