Skip to content

fix: code improvement for multi-arch images #646

fix: code improvement for multi-arch images

fix: code improvement for multi-arch images #646

name: Build and Push Docker Images
on:
pull_request:
push:
branches:
- master
tags:
- 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/maple.1', tag the image as 'maple.1'.
# 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@v6
with:
script: |
const releasePrefix = 'refs/tags/open-release/';
const tagName = context.ref.split(releasePrefix)[1] || 'latest';
console.log('Will use tag: ' + tagName);
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
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and push dev Docker image
uses: docker/build-push-action@v4
with:

Check failure on line 48 in .github/workflows/push-docker-image.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/push-docker-image.yml

Invalid workflow file

You have an error in your yaml syntax on line 48
push: ${{ github.event_name == 'pull_request' }}
target: dev
repository: openedx/credentials-dev
tags: "openedx/credentials-dev:${{ steps.get-tag-name.outputs.result }}","openedx/credentials-dev:${{ github.sha }}"
platforms: linux/amd64,linux/arm64