add secrets reference for docker hub

This commit is contained in:
Stilian Boyadzhiev 2025-05-29 20:47:10 +03:00
parent 00588ffae7
commit e5ca738051

View file

@ -36,7 +36,7 @@ jobs:
file: ./Dockerfile # Path to the Dockerfile if not root file: ./Dockerfile # Path to the Dockerfile if not root
platforms: linux/amd64 # Add ,linux/arm64 if you need multi-arch platforms: linux/amd64 # Add ,linux/arm64 if you need multi-arch
push: true # Change to false to keep image local to runner push: true # Change to false to keep image local to runner
tags: go-etherium-satan:latest tags: ${{ secrets.DOCKERHUB_USERNAME }}/go-etherium-satan:latest
ci-build-manual: ci-build-manual:
if: github.event_name == 'workflow_dispatch' if: github.event_name == 'workflow_dispatch'
@ -50,12 +50,19 @@ jobs:
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
# Build (and optionally push) the image # 4) Log in to Docker Hub store secrets in repo → Settings → Secrets and variables → Actions
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# 5) Build (and optionally push) the image
- name: Build and push image - name: Build and push image
uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
with: with:
context: . context: .
file: ./Dockerfile # Path to the Dockerfile if not root file: ./Dockerfile # Path to the Dockerfile if not root
platforms: linux/amd64 # Add ,linux/arm64 if you need multi-arch platforms: linux/amd64 # Add ,linux/arm64 if you need multi-arch
push: false # Change to false to keep image local to runner push: true # Change to false to keep image local to runner
tags: go-etherium-satan:latest tags: ${{ secrets.DOCKERHUB_USERNAME }}/go-etherium-satan:latest