mirror of
https://github.com/sergi0g/cup.git
synced 2025-11-08 13:13:49 -05:00
53 lines
1.2 KiB
YAML
53 lines
1.2 KiB
YAML
name: Build Image
|
|
inputs:
|
|
tags:
|
|
description: "Docker image tags"
|
|
required: true
|
|
gh-token:
|
|
description: "Github token"
|
|
required: true
|
|
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Download binaries
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
path: .
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Docker meta
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: |
|
|
ghcr.io/sergi0g/cup
|
|
tags: ${{ inputs.tags }}
|
|
|
|
- name: Login to GitHub Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: sergi0g
|
|
password: ${{ inputs.gh-token }}
|
|
|
|
- name: Build and push image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: ./.github/actions/build-image/Dockerfile
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|