From 2af4b447ec94c32e6bca14824e773a3fbddf99ee Mon Sep 17 00:00:00 2001 From: Valera Bronshtein <105710429+valeraBr@users.noreply.github.com> Date: Wed, 20 Sep 2023 13:26:59 +0300 Subject: [PATCH 01/18] Create push_to_registry.yml --- .github/workflows/push_to_registry.yml | 29 ++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/push_to_registry.yml diff --git a/.github/workflows/push_to_registry.yml b/.github/workflows/push_to_registry.yml new file mode 100644 index 000000000..84c9bc0b0 --- /dev/null +++ b/.github/workflows/push_to_registry.yml @@ -0,0 +1,29 @@ +name: ci + +on: + push: + branches: + - "push_to_reg" + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + tags: memphisos/memphis-qa:check From 61c252850decedf8025e0a93050071c916944a30 Mon Sep 17 00:00:00 2001 From: Valera Bronshtein <105710429+valeraBr@users.noreply.github.com> Date: Wed, 20 Sep 2023 13:34:06 +0300 Subject: [PATCH 02/18] Update push_to_registry.yml --- .github/workflows/push_to_registry.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push_to_registry.yml b/.github/workflows/push_to_registry.yml index 84c9bc0b0..7875a1c81 100644 --- a/.github/workflows/push_to_registry.yml +++ b/.github/workflows/push_to_registry.yml @@ -26,4 +26,4 @@ jobs: context: . platforms: linux/amd64,linux/arm64 push: true - tags: memphisos/memphis-qa:check + tags: memphisos/memphis-qa:check5 From 4fc72207d2fe81fc1d2fbb081a4bbb6d7ceaa347 Mon Sep 17 00:00:00 2001 From: Valera Bronshtein <105710429+valeraBr@users.noreply.github.com> Date: Wed, 20 Sep 2023 14:00:10 +0300 Subject: [PATCH 03/18] Update push_to_registry.yml --- .github/workflows/push_to_registry.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/push_to_registry.yml b/.github/workflows/push_to_registry.yml index 7875a1c81..01e013af5 100644 --- a/.github/workflows/push_to_registry.yml +++ b/.github/workflows/push_to_registry.yml @@ -26,4 +26,6 @@ jobs: context: . platforms: linux/amd64,linux/arm64 push: true - tags: memphisos/memphis-qa:check5 + tags: | + memphisos/memphis-qa:check5 + memphisos/memphis-qa:${{ github.event.number }} From 5bfe113dce1d811008e9e84bcf686208795fb5ed Mon Sep 17 00:00:00 2001 From: Valera Bronshtein <105710429+valeraBr@users.noreply.github.com> Date: Wed, 20 Sep 2023 14:09:41 +0300 Subject: [PATCH 04/18] Update push_to_registry.yml --- .github/workflows/push_to_registry.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/push_to_registry.yml b/.github/workflows/push_to_registry.yml index 01e013af5..a1b749086 100644 --- a/.github/workflows/push_to_registry.yml +++ b/.github/workflows/push_to_registry.yml @@ -26,6 +26,4 @@ jobs: context: . platforms: linux/amd64,linux/arm64 push: true - tags: | - memphisos/memphis-qa:check5 - memphisos/memphis-qa:${{ github.event.number }} + tags: memphisos/memphis-qa:${{ github.event.number }} From 236dcd4d81080e00d5c84d016e6e568072778b86 Mon Sep 17 00:00:00 2001 From: Valera Bronshtein <105710429+valeraBr@users.noreply.github.com> Date: Wed, 20 Sep 2023 14:15:33 +0300 Subject: [PATCH 05/18] Update push_to_registry.yml --- .github/workflows/push_to_registry.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push_to_registry.yml b/.github/workflows/push_to_registry.yml index a1b749086..6df29cae6 100644 --- a/.github/workflows/push_to_registry.yml +++ b/.github/workflows/push_to_registry.yml @@ -26,4 +26,4 @@ jobs: context: . platforms: linux/amd64,linux/arm64 push: true - tags: memphisos/memphis-qa:${{ github.event.number }} + tags: memphisos/memphis-qa:${{ github.ref_name}} From e25f5e0d66086f1e5e73bdae46d7c398fef0a586 Mon Sep 17 00:00:00 2001 From: Valera Bronshtein <105710429+valeraBr@users.noreply.github.com> Date: Wed, 20 Sep 2023 14:40:11 +0300 Subject: [PATCH 06/18] Update push_to_registry.yml --- .github/workflows/push_to_registry.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/push_to_registry.yml b/.github/workflows/push_to_registry.yml index 6df29cae6..42dfa8ae9 100644 --- a/.github/workflows/push_to_registry.yml +++ b/.github/workflows/push_to_registry.yml @@ -20,10 +20,15 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Get Pull Request Number + run: echo "PULL_NUMBER=$(echo "$GITHUB_REF" | awk -F / '{print $3}')" >> $GITHUB_ENV + shell: bash - name: Build and push uses: docker/build-push-action@v5 with: context: . platforms: linux/amd64,linux/arm64 push: true - tags: memphisos/memphis-qa:${{ github.ref_name}} + tags: | + memphisos/memphis-qa:${{ github.ref_name}} + memphisos/memphis-qa:${{ env.PULL_NUMBER }} From 6e7c4d9ca90c5b749870b2f454aa0a6c9a2e7d38 Mon Sep 17 00:00:00 2001 From: Valera Bronshtein <105710429+valeraBr@users.noreply.github.com> Date: Wed, 20 Sep 2023 14:43:31 +0300 Subject: [PATCH 07/18] Update push_to_registry.yml --- .github/workflows/push_to_registry.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/push_to_registry.yml b/.github/workflows/push_to_registry.yml index 42dfa8ae9..85d515bfe 100644 --- a/.github/workflows/push_to_registry.yml +++ b/.github/workflows/push_to_registry.yml @@ -5,6 +5,9 @@ on: branches: - "push_to_reg" +env: + PR_NUMBER: ${{ github.event.number }} + jobs: docker: runs-on: ubuntu-latest @@ -31,4 +34,4 @@ jobs: push: true tags: | memphisos/memphis-qa:${{ github.ref_name}} - memphisos/memphis-qa:${{ env.PULL_NUMBER }} + memphisos/memphis-qa:${{ env.PR_NUMBER }} From b2a838a8777849c4ab064a2a4950c441e8b22a5e Mon Sep 17 00:00:00 2001 From: Valera Bronshtein <105710429+valeraBr@users.noreply.github.com> Date: Wed, 20 Sep 2023 14:46:53 +0300 Subject: [PATCH 08/18] Update push_to_registry.yml --- .github/workflows/push_to_registry.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/push_to_registry.yml b/.github/workflows/push_to_registry.yml index 85d515bfe..6d8ef6124 100644 --- a/.github/workflows/push_to_registry.yml +++ b/.github/workflows/push_to_registry.yml @@ -5,9 +5,6 @@ on: branches: - "push_to_reg" -env: - PR_NUMBER: ${{ github.event.number }} - jobs: docker: runs-on: ubuntu-latest @@ -34,4 +31,4 @@ jobs: push: true tags: | memphisos/memphis-qa:${{ github.ref_name}} - memphisos/memphis-qa:${{ env.PR_NUMBER }} + memphisos/memphis-qa:${{ github.event.pull_request.number }} From ff2c29f8be84137d921969dbe6b1aa7b6ad08f50 Mon Sep 17 00:00:00 2001 From: Valera Bronshtein <105710429+valeraBr@users.noreply.github.com> Date: Wed, 20 Sep 2023 14:51:37 +0300 Subject: [PATCH 09/18] Update push_to_registry.yml --- .github/workflows/push_to_registry.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/push_to_registry.yml b/.github/workflows/push_to_registry.yml index 6d8ef6124..9794498b1 100644 --- a/.github/workflows/push_to_registry.yml +++ b/.github/workflows/push_to_registry.yml @@ -4,6 +4,8 @@ on: push: branches: - "push_to_reg" +env: + PR_NUMBER: ${{ github.event.number }} jobs: docker: @@ -31,4 +33,4 @@ jobs: push: true tags: | memphisos/memphis-qa:${{ github.ref_name}} - memphisos/memphis-qa:${{ github.event.pull_request.number }} + memphisos/memphis-qa:$PR_NUMBER From ecdfac808e50ed7278a020656bb512ffcc306637 Mon Sep 17 00:00:00 2001 From: Valera Bronshtein <105710429+valeraBr@users.noreply.github.com> Date: Wed, 20 Sep 2023 14:58:48 +0300 Subject: [PATCH 10/18] Update push_to_registry.yml --- .github/workflows/push_to_registry.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/push_to_registry.yml b/.github/workflows/push_to_registry.yml index 9794498b1..b1baa61a0 100644 --- a/.github/workflows/push_to_registry.yml +++ b/.github/workflows/push_to_registry.yml @@ -4,8 +4,6 @@ on: push: branches: - "push_to_reg" -env: - PR_NUMBER: ${{ github.event.number }} jobs: docker: @@ -15,7 +13,7 @@ jobs: uses: actions/checkout@v4 - name: Set up QEMU uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx + - name: Set up Docker Buildxe uses: docker/setup-buildx-action@v3 - name: Login to Docker Hub uses: docker/login-action@v3 @@ -27,10 +25,12 @@ jobs: shell: bash - name: Build and push uses: docker/build-push-action@v5 + env: + PR_NUMBER: ${{ github.event.number }} with: context: . platforms: linux/amd64,linux/arm64 push: true tags: | memphisos/memphis-qa:${{ github.ref_name}} - memphisos/memphis-qa:$PR_NUMBER + memphisos/memphis-qa:${{ PULL_NUMBER }} From efba8924f6b7abbf0076d7deb5ca1e5bc349d79c Mon Sep 17 00:00:00 2001 From: Valera Bronshtein <105710429+valeraBr@users.noreply.github.com> Date: Wed, 20 Sep 2023 15:00:33 +0300 Subject: [PATCH 11/18] Update push_to_registry.yml --- .github/workflows/push_to_registry.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push_to_registry.yml b/.github/workflows/push_to_registry.yml index b1baa61a0..917d962ea 100644 --- a/.github/workflows/push_to_registry.yml +++ b/.github/workflows/push_to_registry.yml @@ -21,7 +21,9 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Get Pull Request Number - run: echo "PULL_NUMBER=$(echo "$GITHUB_REF" | awk -F / '{print $3}')" >> $GITHUB_ENV + run: | + echo "PULL_NUMBER=$(echo "$GITHUB_REF" | awk -F / '{print $3}')" >> $GITHUB_ENV + echo "PULL_NUMBER=$(echo "$GITHUB_REF" | awk -F / '{print $3}')" shell: bash - name: Build and push uses: docker/build-push-action@v5 @@ -33,4 +35,4 @@ jobs: push: true tags: | memphisos/memphis-qa:${{ github.ref_name}} - memphisos/memphis-qa:${{ PULL_NUMBER }} + memphisos/memphis-qa:${{ env.PULL_NUMBER }} From 2eced50bd73036b9997de902c89488edb7251b60 Mon Sep 17 00:00:00 2001 From: Valera Bronshtein <105710429+valeraBr@users.noreply.github.com> Date: Wed, 20 Sep 2023 15:03:14 +0300 Subject: [PATCH 12/18] Update push_to_registry.yml --- .github/workflows/push_to_registry.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push_to_registry.yml b/.github/workflows/push_to_registry.yml index 917d962ea..8216e4ced 100644 --- a/.github/workflows/push_to_registry.yml +++ b/.github/workflows/push_to_registry.yml @@ -23,7 +23,7 @@ jobs: - name: Get Pull Request Number run: | echo "PULL_NUMBER=$(echo "$GITHUB_REF" | awk -F / '{print $3}')" >> $GITHUB_ENV - echo "PULL_NUMBER=$(echo "$GITHUB_REF" | awk -F / '{print $3}')" + echo "PULL_NUMBER=$(echo "$GITHUB_REF" )" shell: bash - name: Build and push uses: docker/build-push-action@v5 From 68c99ee693b0498a9850f44a5ffccc81e497e912 Mon Sep 17 00:00:00 2001 From: Valera Bronshtein <105710429+valeraBr@users.noreply.github.com> Date: Wed, 20 Sep 2023 15:08:52 +0300 Subject: [PATCH 13/18] Update push_to_registry.yml --- .github/workflows/push_to_registry.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push_to_registry.yml b/.github/workflows/push_to_registry.yml index 8216e4ced..92d14dc7b 100644 --- a/.github/workflows/push_to_registry.yml +++ b/.github/workflows/push_to_registry.yml @@ -1,7 +1,7 @@ name: ci on: - push: + pull_request: branches: - "push_to_reg" From c3cb7e4d52cb53c26a178206b2e6d9ddffe7c7bb Mon Sep 17 00:00:00 2001 From: Valera Bronshtein <105710429+valeraBr@users.noreply.github.com> Date: Wed, 20 Sep 2023 15:11:16 +0300 Subject: [PATCH 14/18] Update push_to_registry.yml --- .github/workflows/push_to_registry.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push_to_registry.yml b/.github/workflows/push_to_registry.yml index 92d14dc7b..b1e810e27 100644 --- a/.github/workflows/push_to_registry.yml +++ b/.github/workflows/push_to_registry.yml @@ -35,4 +35,4 @@ jobs: push: true tags: | memphisos/memphis-qa:${{ github.ref_name}} - memphisos/memphis-qa:${{ env.PULL_NUMBER }} + memphisos/memphis-qa:${{ env.PR_NUMBER }} From 687166508da8cd16b7fe26a8033d4b08c58ff0c3 Mon Sep 17 00:00:00 2001 From: Valera Bronshtein <105710429+valeraBr@users.noreply.github.com> Date: Wed, 20 Sep 2023 15:13:52 +0300 Subject: [PATCH 15/18] Update push_to_registry.yml --- .github/workflows/push_to_registry.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/push_to_registry.yml b/.github/workflows/push_to_registry.yml index b1e810e27..4ea2d0dd4 100644 --- a/.github/workflows/push_to_registry.yml +++ b/.github/workflows/push_to_registry.yml @@ -20,11 +20,6 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Get Pull Request Number - run: | - echo "PULL_NUMBER=$(echo "$GITHUB_REF" | awk -F / '{print $3}')" >> $GITHUB_ENV - echo "PULL_NUMBER=$(echo "$GITHUB_REF" )" - shell: bash - name: Build and push uses: docker/build-push-action@v5 env: @@ -34,5 +29,5 @@ jobs: platforms: linux/amd64,linux/arm64 push: true tags: | - memphisos/memphis-qa:${{ github.ref_name}} + memphisos/memphis-qa:latest memphisos/memphis-qa:${{ env.PR_NUMBER }} From e811234d6ca0ecf339d698dd2683b8b675ecc67d Mon Sep 17 00:00:00 2001 From: Valera Bronshtein <105710429+valeraBr@users.noreply.github.com> Date: Wed, 20 Sep 2023 15:36:03 +0300 Subject: [PATCH 16/18] Update push_to_registry.yml --- .github/workflows/push_to_registry.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/push_to_registry.yml b/.github/workflows/push_to_registry.yml index 4ea2d0dd4..fad98afa5 100644 --- a/.github/workflows/push_to_registry.yml +++ b/.github/workflows/push_to_registry.yml @@ -1,14 +1,15 @@ name: ci - on: - pull_request: - branches: - - "push_to_reg" + pull_request_review: + types: [submitted] jobs: - docker: + approved: + if: github.event.review.state == 'approved' runs-on: ubuntu-latest steps: + - name: Starting + run: echo "This PR was approved" - name: Checkout uses: actions/checkout@v4 - name: Set up QEMU From e3d49a8bf33ecbd9d832b763e2d2795619dafa1c Mon Sep 17 00:00:00 2001 From: Valera Bronshtein <105710429+valeraBr@users.noreply.github.com> Date: Wed, 20 Sep 2023 15:42:59 +0300 Subject: [PATCH 17/18] Update push_to_registry.yml --- .github/workflows/push_to_registry.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/push_to_registry.yml b/.github/workflows/push_to_registry.yml index fad98afa5..b52345817 100644 --- a/.github/workflows/push_to_registry.yml +++ b/.github/workflows/push_to_registry.yml @@ -21,14 +21,15 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Get Pull Request Number + run: echo "PULL_NUMBER=$(echo "$GITHUB_REF" | awk -F / '{print $3}')" >> $GITHUB_ENV + shell: bash - name: Build and push uses: docker/build-push-action@v5 - env: - PR_NUMBER: ${{ github.event.number }} with: context: . platforms: linux/amd64,linux/arm64 push: true tags: | memphisos/memphis-qa:latest - memphisos/memphis-qa:${{ env.PR_NUMBER }} + memphisos/memphis-qa:${{ env.PULL_NUMBER }} From 9bc9f982a0558d3383945a18c4871c455bf49284 Mon Sep 17 00:00:00 2001 From: Valera Bronshtein <105710429+valeraBr@users.noreply.github.com> Date: Wed, 20 Sep 2023 15:59:14 +0300 Subject: [PATCH 18/18] Update push_to_registry.yml --- .github/workflows/push_to_registry.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/push_to_registry.yml b/.github/workflows/push_to_registry.yml index b52345817..0bcc9aebc 100644 --- a/.github/workflows/push_to_registry.yml +++ b/.github/workflows/push_to_registry.yml @@ -1,7 +1,9 @@ -name: ci +name: build and push image for QA on: pull_request_review: types: [submitted] + branches: + - "master" jobs: approved: