Skip to content
This repository has been archived by the owner on Nov 2, 2023. It is now read-only.

chore(ci): improve pipelines #19

chore(ci): improve pipelines

chore(ci): improve pipelines #19

Workflow file for this run

name: Build Container image
on:
workflow_dispatch:
schedule:
# rebuild latest regulary - to resolve CVEs in base images
- cron: "0 10 * * *"
push:
branches:
- "**"
tags:
- "\\d+\\.\\d+\\.\\d+"
pull_request:
branches:
- "main"
jobs:
build:
name: "Build and publish container image"
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
ghcr.io/${{ github.repository }}
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
push: ${{ github.event_name != 'pull_request' }}
file: Containerfile
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}