Skip to content

Build and Push Docker Images #44

Build and Push Docker Images

Build and Push Docker Images #44

Workflow file for this run

name: Build and Push Docker Images
on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to build (optional)'
required: false
schedule:
- cron: "0 0 * * 1"
push:
branches:
- 'v1.*'
paths:
- Dockerfile
jobs:
build_and_push:
name: Build and Push Docker Image
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
branch:
- v1.11.5
- v1.11.6
- v1.11.7
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch || matrix.branch }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: true
tags: ghcr.io/blueprintframework/blueprint:${{ github.event.inputs.branch || matrix.branch }}
- name: Tag as Latest and Push
if: ${{ matrix.branch == 'v1.11.7' }}
run: |
docker tag ghcr.io/blueprintframework/blueprint:${{ github.event.inputs.branch || matrix.branch }} ghcr.io/blueprintframework/blueprint:latest
docker push ghcr.io/blueprintframework/blueprint:latest