Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ on:
default: "linux/amd64"
type: string
secrets:
dockerhub-username:
required: true
dockerhub-password:
required: true
username:
required: false
password:
Expand Down Expand Up @@ -104,6 +108,12 @@ jobs:
uses: docker/setup-qemu-action@v4

- name: Login to Docker Hub
uses: docker/login-action@v4
with:
username: ${{ secrets.dockerhub-username }}
password: ${{ secrets.dockerhub-password }}
Comment thread
jbern0rd marked this conversation as resolved.

- name: Login to Docker Registry
if: ${{ inputs.push }}
uses: docker/login-action@v4
with:
Expand Down
12 changes: 8 additions & 4 deletions docker-build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ Perfect for teams looking to streamline their containerization workflow with min

## 🔐 Secrets

| Name | Description | Required |
| ---------- | --------------------------------------------------------------------------------------------------- | -------- |
| `username` | Username for Docker Registry authentication | Yes |
| `password` | Password or Personal Access Token for Docker registry authentication (with appropriate permissions) | Yes |
| Name | Description | Required |
| -------------------- | --------------------------------------------------------------------------------------------------- | ------------------ |
| `dockerhub-username` | Username for Docker Hub authentication | Yes |
| `dockerhub-password` | Token for Docker Hub authentication (with read-only permissions) | Yes |
| `username` | Username for Docker Registry authentication | When `push: true` |
| `password` | Password or Personal Access Token for Docker registry authentication (with appropriate permissions) | When `push: true` |

## 💻 Example Usage

Expand Down Expand Up @@ -74,6 +76,8 @@ jobs:
BUILD_VERSION=1.0.0
NODE_ENV=production
secrets:
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub-password: ${{ secrets.DOCKERHUB_TOKEN_PULL_ONLY }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PAT }}
```
Expand Down