Build Docker images with GitHub Actions (#16)
* WIP GitHub Actions Workflow * Split into reusable workflow * Generate MXE and Win builds
This commit is contained in:
63
.github/workflows/build.yaml
vendored
Normal file
63
.github/workflows/build.yaml
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
name: Build
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
file:
|
||||
required: true
|
||||
type: string
|
||||
description: Dockerfile to use
|
||||
tag:
|
||||
required: true
|
||||
type: string
|
||||
description: Docker tag to generate
|
||||
load:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
description: Load docker image
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE: ${{ github.repository_owner }}/qt
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Login to GHCR
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
registry: ${{ env.REGISTRY }}
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE }}
|
||||
flavor: |
|
||||
latest=false
|
||||
tags: |
|
||||
type=raw,value=${{ inputs.tag }}
|
||||
type=ref,event=tag,enable=${{ inputs.tag == 'latest' }}
|
||||
|
||||
- name: Build
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
file: ${{ inputs.file }}
|
||||
sbom: true
|
||||
provenance: true
|
||||
load: ${{ inputs.load || 'false' }}
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
Reference in New Issue
Block a user