Skip to content

Build images

Build images #10

Workflow file for this run

name: Build images
on:
workflow_dispatch:
inputs:
name:
type: choice
required: true
description: Build target
options:
- commitlint
- reviewdog
tag:
required: true
description: 'image tag (e.g.: 22.3.0)'
jobs:
publish:
name: Build image
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- uses: docker/metadata-action@v4
id: meta
with:
images: ghcr.io/${{ github.repository_owner }}/${{ github.event.inputs.name }}-base
tags: |
type=raw,value=${{ github.event.inputs.tag }}
- name: Build and Push a Image
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
context: ./${{ github.event.inputs.name }}
file: ./${{ github.event.inputs.name }}/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}