Skip to content

Build images

Build images #4

Workflow file for this run

name: Build environment image
on:
release:
types: [ published ]
workflow_dispatch:
inputs:
image:
type: choice
description: Image to build
options:
- base
required: true
tag:
description: Image tag
required: true
tag-latest:
type: boolean
description: Also tag as latest
jobs:
build:
runs-on: ubuntu-latest
# see https://github.com/docker/build-push-action
steps:
# Setup (see https://github.com/docker/build-push-action)
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
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@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push (tag latest)
uses: docker/build-push-action@v5
if: ${{ github.event.inputs.tag-latest == 'true' }}
with:
push: true
context: images/${{ github.event.inputs.image }}
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
blsq/openhexa-base-environment:${{ github.event.inputs.tag }}
blsq/openhexa-base-environment:latest
- name: Build and push (don't tag latest)
uses: docker/build-push-action@v5
if: ${{ github.event.inputs.tag-latest == 'false' }}
with:
push: true
context: images/${{ github.event.inputs.image }}
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
blsq/openhexa-base-environment:${{ github.event.inputs.tag }}