Skip to content

Commit

Permalink
INTG-2169 docker login (#231)
Browse files Browse the repository at this point in the history
Changed goreleaser entry point so we can auth to docker
  • Loading branch information
MickStanciu authored Mar 23, 2022
1 parent 3aaefbd commit 917b489
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ jobs:
with:
go-version: 1.17

- name: Login to Docker Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: docker
password: ${{ secrets.GITHUB_TOKEN }}

- name: Setup release environment
run: |-
echo 'GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}' >> .release-env
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ release:
docker run \
--rm \
--privileged \
--entrypoint ./goreleaser_entry.sh \
--env-file .release-env \
-v /var/run/docker.sock:/var/run/docker.sock \
-v `pwd`:/go/src/$(PACKAGE_NAME) \
Expand Down
10 changes: 10 additions & 0 deletions goreleaser_entry.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -e

echo "DOING DOCKER LOGIN"
if ! echo "$GITHUB_TOKEN" | docker login -u docker --password-stdin ghcr.io ; then
exit 1
fi

echo "CONTINUE WITH GORELEASER"
exec goreleaser "$@"

0 comments on commit 917b489

Please sign in to comment.