From 1ec653100a0181ddaefcc9787c46339dba508163 Mon Sep 17 00:00:00 2001 From: Irtaza Akram Date: Thu, 2 May 2024 15:25:28 +0500 Subject: [PATCH 1/2] fix: push docker image ci tags --- .github/workflows/push-docker-image.yml | 43 +++++++++++-------------- 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/.github/workflows/push-docker-image.yml b/.github/workflows/push-docker-image.yml index aa09d8c1..d46f05ad 100644 --- a/.github/workflows/push-docker-image.yml +++ b/.github/workflows/push-docker-image.yml @@ -5,21 +5,19 @@ on: branches: - master - open-release/** + jobs: push: runs-on: ubuntu-latest if: github.event_name == 'push' steps: - - name: Checkout - uses: actions/checkout@v3 - # Use the release name as the image tag if we're building an open release tag. # Examples: if we're building 'open-release/olive.master', tag the image as 'olive.master'. # Otherwise, we must be building from a push to master, so use 'latest'. - name: Get tag name id: get-tag-name - uses: actions/github-script@v5 + uses: actions/github-script@v7 with: script: | const branchName = context.ref.split('/').slice(-1)[0]; @@ -28,37 +26,34 @@ jobs: return tagName; result-encoding: string - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - name: Login to DockerHub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + - name: Build and push Dev Docker image - uses: docker/build-push-action@v4 - + uses: docker/build-push-action@v5 with: push: true - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} target: dev - repository: openedx/edx-notes-api-dev - tags: ${{ steps.get-tag-name.outputs.result }},${{ github.sha }} + tags: | + openedx/edx-notes-api-dev:${{ steps.get-tag-name.outputs.result }} + openedx/edx-notes-api-dev:${{ github.sha }} platforms: linux/amd64,linux/arm64 # - name: Build and push prod Docker image - # uses: docker/build-push-action@v4 + # uses: docker/build-push-action@v5 # with: # push: true - # username: ${{ secrets.DOCKERHUB_USERNAME }} - # password: ${{ secrets.DOCKERHUB_PASSWORD }} # target: prod - # repository: openedx/edx-notes-api - # tags: ${{ steps.get-tag-name.outputs.result }},${{ github.sha }} - # platforms: linux/amd64,linux/arm64 \ No newline at end of file + # tags: | + # openedx/edx-notes-api:${{ steps.get-tag-name.outputs.result }} + # openedx/edx-notes-api:${{ github.sha }} + # platforms: linux/amd64,linux/arm64 From d7beb5ddcac633689a53dc0374bbb3fd0ab41bf2 Mon Sep 17 00:00:00 2001 From: Irtaza Akram Date: Thu, 2 May 2024 15:36:22 +0500 Subject: [PATCH 2/2] fix: uncomment production image build in ci --- .github/workflows/push-docker-image.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/push-docker-image.yml b/.github/workflows/push-docker-image.yml index d46f05ad..68ba01fd 100644 --- a/.github/workflows/push-docker-image.yml +++ b/.github/workflows/push-docker-image.yml @@ -48,12 +48,12 @@ jobs: openedx/edx-notes-api-dev:${{ github.sha }} platforms: linux/amd64,linux/arm64 - # - name: Build and push prod Docker image - # uses: docker/build-push-action@v5 - # with: - # push: true - # target: prod - # tags: | - # openedx/edx-notes-api:${{ steps.get-tag-name.outputs.result }} - # openedx/edx-notes-api:${{ github.sha }} - # platforms: linux/amd64,linux/arm64 + - name: Build and push Prod Docker image + uses: docker/build-push-action@v5 + with: + push: true + target: prod + tags: | + openedx/edx-notes-api:${{ steps.get-tag-name.outputs.result }} + openedx/edx-notes-api:${{ github.sha }} + platforms: linux/amd64,linux/arm64