Skip to content

Commit

Permalink
Include docker login in Makefile using REGISTRY_USERNAME/PASSWORD
Browse files Browse the repository at this point in the history
  • Loading branch information
jingyuanliang committed Jun 18, 2023
1 parent 3767ea8 commit f58c92e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,8 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
run: make manifest-list
run: make login manifest-list
env:
REGISTRY: ghcr.io/${{ github.repository }}
REGISTRY_USERNAME: ${{ github.actor }}
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,11 @@ $(CONTAINER_DOTFILES): .buildx-initialized
docker images -q $(REGISTRY)/$(BIN):$(TAG) > $@
echo

login: # @HELP configures docker to be authenticated to the defined registry
docker login $(REGISTRY) \
-u "$(REGISTRY_USERNAME)" \
-p "$(REGISTRY_PASSWORD)"

push: # @HELP pushes the container for one platform ($OS/$ARCH) to the defined registry
push: container
for bin in $(BINS); do \
Expand Down

0 comments on commit f58c92e

Please sign in to comment.