2022-04-25 11:06:01 +02:00
|
|
|
name: Container
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
paths-ignore:
|
|
|
|
- '.devcontainer/**'
|
|
|
|
- 'examples/**'
|
|
|
|
- 'lib/**'
|
|
|
|
- 'man/**'
|
|
|
|
- 'priv/**'
|
|
|
|
- '**.md'
|
|
|
|
|
|
|
|
env:
|
|
|
|
REGISTRY: ghcr.io
|
|
|
|
IMAGE_NAME: ${{ github.repository }}
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
container:
|
|
|
|
name: Container
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
permissions:
|
|
|
|
packages: write
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Check out repository code
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Log in to the Container registry
|
|
|
|
uses: docker/login-action@v1.14.1
|
|
|
|
with:
|
|
|
|
registry: ${{ env.REGISTRY }}
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Get git describe
|
|
|
|
id: gitdescribe
|
|
|
|
run: echo "::set-output name=ver::$(git describe --tags)"
|
|
|
|
|
|
|
|
- name: Extract metadata (tags, labels) for Docker
|
|
|
|
id: meta
|
|
|
|
uses: docker/metadata-action@v3.8.0
|
|
|
|
with:
|
|
|
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
|
|
labels: |
|
|
|
|
org.opencontainers.image.revision=${{ steps.gitdescribe.outputs.ver }}
|
|
|
|
org.opencontainers.image.licenses=GPL-2.0
|
|
|
|
org.opencontainers.image.vendor=ProcessOne
|
|
|
|
|
|
|
|
- name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
|
|
|
|
- name: Build and push Docker image
|
|
|
|
uses: docker/build-push-action@v2.10.0
|
|
|
|
with:
|
|
|
|
build-args: |
|
|
|
|
VERSION=${{ steps.gitdescribe.outputs.ver }}
|
|
|
|
cache-from: type=gha
|
|
|
|
cache-to: type=gha,mode=max
|
|
|
|
context: .github/container
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|
2022-05-04 12:39:59 +02:00
|
|
|
platforms: linux/amd64,linux/arm64
|
2022-04-25 11:06:01 +02:00
|
|
|
push: true
|
2022-05-06 17:58:58 +02:00
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|