Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 23 additions & 28 deletions .github/workflows/push-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -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
# 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
- name: Build and push Prod Docker image

@farhan farhan May 6, 2024

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@feanil
Prod images were commented in this PR
Do you have information why did we do that?
Seems ok to me to uncomment it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're not pushing the images, then we don't need this workflow at all. Let's just remove it, it was 2U specific anyway.

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