Skip to content

chore: enable github action auto update in dependabot.yml (#429) #186

chore: enable github action auto update in dependabot.yml (#429)

chore: enable github action auto update in dependabot.yml (#429) #186

name: Build and Push Docker Images
on:
push:
branches:
- master
- open-release/**
jobs:
push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# 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@v7
with:
script: |
const branchName = context.ref.split('/').slice(-1)[0];
const tagName = branchName === 'master' ? 'latest' : branchName;
console.log('Will use tag: ' + tagName);
return tagName;
result-encoding: string
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and push Dev Docker image
uses: docker/build-push-action@v6
with:
push: true
target: dev
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@v6
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