Skip to content

Docker image

Docker image #11

Workflow file for this run

name: Docker image
on:
workflow_dispatch:
permissions:
packages: write
env:
IMAGE_NAME: pufferpanel
IMAGE_REGISTRY: ghcr.io/oskardotglobal
REGISTRY_USER: oskardotglobal
REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
jobs:
build:
runs-on: ubuntu-22.04
strategy:
fail-fast: true
matrix:
platform:
- "amd64"
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: ${{ matrix.platform }}
if: ${{ matrix.platform != 'amd64' }}
- name: Get dates
id: date
run: |
echo "build=$(date --rfc-3339 ns)" >> $GITHUB_OUTPUT
echo "tag=$(date +%Y%m%d)" >> $GITHUB_OUTPUT
- name: Build image
id: base
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.IMAGE_NAME }}
tags: ${{ steps.date.outputs.tag }} latest
context: .
platforms: linux/${{ matrix.platform }}
containerfiles: |
Dockerfile
build-args: |
ARCH=${{ matrix.platform }}
BUILD_DATE=${{ steps.date.outputs.build }}
VCS_REF=${{ github.sha }}
- name: Push image to GHCR
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.base.outputs.image }}
tags: ${{ steps.base.outputs.tags }}
registry: ${{ env.IMAGE_REGISTRY }}
username: ${{ env.REGISTRY_USER }}
password: ${{ env.REGISTRY_PASSWORD }}