From 5333f9394221aa8c3e94e0c7a252e6b4e21f368a Mon Sep 17 00:00:00 2001 From: Jakub Scholz Date: Thu, 7 Dec 2023 22:59:48 +0100 Subject: [PATCH] Add Docker login Signed-off-by: Jakub Scholz --- .github/workflows/main.yml | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d1a791f..16d38b2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,14 +4,20 @@ on: push: branches: [ "main" ] -permissions: - contents: read - jobs: build: name: Build runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + env: + DOCKER_REGISTRY: ghcr.io + DOCKER_ORG: scholzj + DOCKER_TAG: latest + # strategy: # fail-fast: false # matrix: @@ -40,17 +46,32 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@v2 + # Setup Docker credentials + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + registry: ${{ env.DOCKER_REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} +# with: +# username: ${{ secrets.DOCKER_USERNAME }} +# password: ${{ secrets.DOCKER_PASSWORD }} + # Build the Java project - name: Build the Java project run: make build # Build the Container images - name: Build and push the containers for amd64 - run: DOCKER_ARCHITECTURE=amd64 make docker_build docker_push docker_amend_manifest + run: make docker_build docker_push docker_amend_manifest + env: + DOCKER_ARCHITECTURE: amd64 # with: # architecture: ${{ matrix.language }} - name: Build and push the containers for arm64 - run: DOCKER_ARCHITECTURE=arm64 make docker_build docker_push docker_amend_manifest + run: make docker_build docker_push docker_amend_manifest + env: + DOCKER_ARCHITECTURE: arm64 # Push the container manifest - name: Push the container manifest