From f58c92e7df6c8411d7729c7b60430e8073bfc03b Mon Sep 17 00:00:00 2001 From: Jingyuan Liang Date: Sun, 18 Jun 2023 19:56:10 +0000 Subject: [PATCH] Include `docker login` in Makefile using REGISTRY_USERNAME/PASSWORD --- .github/workflows/publish.yaml | 9 +-------- Makefile | 5 +++++ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 12031eb4..bc2856d5 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -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 }} diff --git a/Makefile b/Makefile index 36e9db70..90896093 100644 --- a/Makefile +++ b/Makefile @@ -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 \