Skip to content

Workflow file for this run

name: Build and Push Docker Image
on:
release:
types:
- published
- edited
pull_request:
branches:
- main
types:
- opened
- synchronize
- reopened
paths:
- cli/**
- semver/**
- Dockerfile
- Makefile
concurrency:
group: "${{ github.workflow }}-${{ github.ref_name }}-${{ github.event_name }}"
cancel-in-progress: true
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4.1.2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.2.0
- name: Login to DockerHub
if: github.event_name == 'release'
uses: docker/login-action@v3.1.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and Push Docker image
uses: docker/build-push-action@v5.3.0
with:
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64/v8
push: ${{ github.event_name == 'release' }}
tags: makepad/semver:${{ (github.event_name == 'release' && github.event.release.tag_name) || github.sha }}
cache-from: type=registry,ref=makepad/semver:${{( github.event_name == 'release' && github.event.release.tag_name) || github.sha }}
cache-to: type=inline