From f5af42dce61b56e9deb2a0eae6953001c8e5e951 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Norman=20K=C3=B6ster?= Date: Tue, 5 Sep 2023 16:22:46 +0200 Subject: [PATCH] actually login into docker before publishing --- .github/workflows/publish.yml | 1 - .github/workflows/publishManual.yml | 7 +------ docker/docker-build-projector.sh | 2 ++ 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ed6db1c..13e8818 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -42,5 +42,4 @@ jobs: env: DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }} DOCKER_HUB_KEY: ${{ secrets.DOCKER_HUB_KEY }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: cd docker && ./docker-build-projector.sh diff --git a/.github/workflows/publishManual.yml b/.github/workflows/publishManual.yml index cc5ca92..e393354 100644 --- a/.github/workflows/publishManual.yml +++ b/.github/workflows/publishManual.yml @@ -29,10 +29,7 @@ jobs: - name: Build and Publish Maven env: - NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} - NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: ./gradlew assemble publish -Partifacts.itemis.cloud.user=${{secrets.ARTIFACTS_ITEMIS_CLOUD_USER}} -Partifacts.itemis.cloud.pw=${{secrets.ARTIFACTS_ITEMIS_CLOUD_PW}} + run: ./gradlew assemble publish -Partifacts.itemis.cloud.user=${{secrets.ARTIFACTS_ITEMIS_CLOUD_USER}} -Partifacts.itemis.cloud.pw=${{secrets.ARTIFACTS_ITEMIS_CLOUD_PW}} -Pgpr.user=${{ github.actor }} -Pgpr.key=${{ secrets.GHP_UNIVERSAL_PUBLISH_TOKEN }} - name: Set up QEMU uses: docker/setup-qemu-action@v2 @@ -46,6 +43,4 @@ jobs: env: DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }} DOCKER_HUB_KEY: ${{ secrets.DOCKER_HUB_KEY }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: cd docker && ./docker-build-projector.sh - diff --git a/docker/docker-build-projector.sh b/docker/docker-build-projector.sh index 1ccd16f..5fd9e61 100755 --- a/docker/docker-build-projector.sh +++ b/docker/docker-build-projector.sh @@ -11,6 +11,8 @@ cp -r ../build/org.modelix/build/artifacts/org.modelix build/artifacts/ MPS_VERSION=$( ./helper/mps-version.sh ) MODELIX_VERSION=$( ./helper/modelix-version.sh ) +docker login -u "$DOCKER_HUB_USER" -p "$DOCKER_HUB_KEY" + if [ "${CI}" = "true" ]; then docker buildx build --platform linux/amd64,linux/arm64 --push --build-arg MPS_VERSION=${MPS_VERSION} -f Dockerfile-projector \ -t "modelix/modelix-projector:${MODELIX_VERSION}" .