Skip to content

Commit 5c62fcd

Browse files
committed
ci: Conditionning docker with the presence of credentials
Signed-off-by: Vincent Boutour <[email protected]>
1 parent 68b8ec8 commit 5c62fcd

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

.github/workflows/build.yaml

+11-6
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,24 @@ jobs:
3838
steps:
3939
- name: Set up Docker Buildx
4040
uses: docker/setup-buildx-action@v1
41-
- name: Login to DockerHub
42-
uses: docker/login-action@v1
43-
with:
44-
username: ${{ secrets.DOCKER_USER }}
45-
password: ${{ secrets.DOCKER_PASS }}
4641
- uses: actions/checkout@v2
4742
- uses: actions/setup-go@v2
4843
with:
4944
go-version: "^1.16"
5045
- name: Build
5146
run: |
5247
curl --disable --silent --show-error --location --max-time 30 "https://raw.githubusercontent.com/ViBiOh/scripts/main/bootstrap" | bash -s "release"
53-
DOCKER_IMAGE="${{ secrets.DOCKER_USER }}/$(make name)" IMAGE_VERSION="$(make version)" ./scripts/release build docker
48+
./scripts/release build
49+
- name: Login to DockerHub
50+
if: secrets.DOCKER_USER != "" && secrets.DOCKER_PASS != ""
51+
uses: docker/login-action@v1
52+
with:
53+
username: ${{ secrets.DOCKER_USER }}
54+
password: ${{ secrets.DOCKER_PASS }}
55+
- name: Docker
56+
if: secrets.DOCKER_USER != "" && secrets.DOCKER_PASS != ""
57+
run: |
58+
DOCKER_IMAGE="${{ secrets.DOCKER_USER }}/$(make name)" IMAGE_VERSION="$(make version)" ./scripts/release docker
5459
5560
publish:
5661
name: Publish

0 commit comments

Comments
 (0)