From ffbc142efe519658074c01b03977db46b986bb13 Mon Sep 17 00:00:00 2001 From: "eugene.zheltov" Date: Thu, 12 Jan 2023 10:58:52 +0000 Subject: [PATCH 1/3] [TH2-4566] Change docker-publish.yml and dev-docker-publish.yml --- .github/workflows/dev-docker-publish.yml | 43 ++++++------------- .github/workflows/docker-publish.yml | 53 ++++++------------------ 2 files changed, 24 insertions(+), 72 deletions(-) diff --git a/.github/workflows/dev-docker-publish.yml b/.github/workflows/dev-docker-publish.yml index 967f8b4..e80e4b9 100644 --- a/.github/workflows/dev-docker-publish.yml +++ b/.github/workflows/dev-docker-publish.yml @@ -2,36 +2,17 @@ name: Build and publish Docker distributions to Github Container Registry ghcr.i on: push: - branches: - - master - paths: - - gradle.properties -# - package_info.json + branches-ignore: + - master +# paths: +# - gradle.properties +# - package_info.json jobs: - build: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.CR_PAT }} - - run: echo "::set-output name=REPOSITORY_NAME::$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" - id: meta - - name: Read version from gradle.properties - id: read_property - uses: christian-draeger/read-properties@1.0.1 - with: - path: ./gradle.properties - property: release_version - - name: Build and push - id: docker_build - uses: docker/build-push-action@v2 - with: - push: true - tags: ghcr.io/${{ github.repository }}:${{ steps.read_property.outputs.value }} - labels: com.exactpro.th2.${{ steps.meta.outputs.REPOSITORY_NAME }}=${{ steps.read_property.outputs.value }} + build-job: + uses: th2-net/.github/.github/workflows/compound-java-dev.yml@main + with: + build-target: 'Docker' + docker-username: ${{ github.actor }} + secrets: + docker-password: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 997a3e4..97a47bc 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -2,46 +2,17 @@ name: Dev build and publish Docker distributions to Github Container Registry gh on: push: - branches-ignore: - - master -# paths: -# - gradle.properties -# - package_info.json + branches: + - master + paths: + - gradle.properties +# - package_info.json jobs: - build: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 -# Prepare custom build version - - name: Get branch name - id: branch - run: echo ::set-output name=branch_name::${GITHUB_REF#refs/*/} - - name: Get release_version - id: ver - uses: christian-draeger/read-properties@1.0.1 - with: - path: gradle.properties - property: release_version - - name: Build custom release version - id: release_ver - run: echo ::set-output name=value::"${{ steps.ver.outputs.value }}-${{ steps.branch.outputs.branch_name }}-${{ github.run_id }}" - - name: Show custom release version - run: echo ${{ steps.release_ver.outputs.value }} -# Build and publish image - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.CR_PAT }} - - run: echo "::set-output name=REPOSITORY_NAME::$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" - id: meta - - name: Build and push - id: docker_build - uses: docker/build-push-action@v2 - with: - push: true - tags: ghcr.io/${{ github.repository }}:${{ steps.release_ver.outputs.value }} - labels: com.exactpro.th2.${{ steps.meta.outputs.REPOSITORY_NAME }}=${{ steps.ver.outputs.value }} \ No newline at end of file + build-job: + uses: th2-net/.github/.github/workflows/compound-java.yml@main + with: + build-target: 'Docker' + docker-username: ${{ github.actor }} + secrets: + docker-password: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 42a9662a25043226cc5470c9d6ce6d187d2df9a0 Mon Sep 17 00:00:00 2001 From: "eugene.zheltov" Date: Thu, 12 Jan 2023 11:07:29 +0000 Subject: [PATCH 2/3] [TH2-4566] Change username and password fields --- .github/workflows/dev-docker-publish.yml | 4 ++-- .github/workflows/docker-publish.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/dev-docker-publish.yml b/.github/workflows/dev-docker-publish.yml index e80e4b9..0a98ee9 100644 --- a/.github/workflows/dev-docker-publish.yml +++ b/.github/workflows/dev-docker-publish.yml @@ -13,6 +13,6 @@ jobs: uses: th2-net/.github/.github/workflows/compound-java-dev.yml@main with: build-target: 'Docker' - docker-username: ${{ github.actor }} + docker-username: ${{ github.repository_owner }} secrets: - docker-password: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + docker-password: ${{ secrets.CR_PAT }} \ No newline at end of file diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 97a47bc..95c47fd 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -13,6 +13,6 @@ jobs: uses: th2-net/.github/.github/workflows/compound-java.yml@main with: build-target: 'Docker' - docker-username: ${{ github.actor }} + docker-username: ${{ github.repository_owner }} secrets: - docker-password: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + docker-password: ${{ secrets.CR_PAT }} \ No newline at end of file From dff0b80d1941b61b01cf28e286413543941e8a7e Mon Sep 17 00:00:00 2001 From: "eugene.zheltov" Date: Thu, 12 Jan 2023 11:10:01 +0000 Subject: [PATCH 3/3] Revert "[TH2-4566] Change username and password fields" This reverts commit 42a9662a25043226cc5470c9d6ce6d187d2df9a0. --- .github/workflows/dev-docker-publish.yml | 4 ++-- .github/workflows/docker-publish.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/dev-docker-publish.yml b/.github/workflows/dev-docker-publish.yml index 0a98ee9..e80e4b9 100644 --- a/.github/workflows/dev-docker-publish.yml +++ b/.github/workflows/dev-docker-publish.yml @@ -13,6 +13,6 @@ jobs: uses: th2-net/.github/.github/workflows/compound-java-dev.yml@main with: build-target: 'Docker' - docker-username: ${{ github.repository_owner }} + docker-username: ${{ github.actor }} secrets: - docker-password: ${{ secrets.CR_PAT }} \ No newline at end of file + docker-password: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 95c47fd..97a47bc 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -13,6 +13,6 @@ jobs: uses: th2-net/.github/.github/workflows/compound-java.yml@main with: build-target: 'Docker' - docker-username: ${{ github.repository_owner }} + docker-username: ${{ github.actor }} secrets: - docker-password: ${{ secrets.CR_PAT }} \ No newline at end of file + docker-password: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file