2020-11-14 15:44:10 +00:00
|
|
|
name: docker
|
2020-11-14 15:28:50 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2023-10-08 16:46:03 +00:00
|
|
|
branches:
|
2020-11-14 15:28:50 +00:00
|
|
|
- master
|
|
|
|
tags:
|
2023-10-08 16:46:03 +00:00
|
|
|
- "v*"
|
2020-11-14 15:28:50 +00:00
|
|
|
|
|
|
|
jobs:
|
2023-10-13 08:03:02 +00:00
|
|
|
build-docker:
|
2023-10-18 09:52:48 +00:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
packages: write
|
2023-10-13 08:03:02 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
platform:
|
|
|
|
- linux/amd64
|
|
|
|
- linux/arm64
|
|
|
|
- linux/386
|
2023-10-18 09:52:48 +00:00
|
|
|
- linux/arm/v5
|
2023-10-13 08:03:02 +00:00
|
|
|
- linux/arm/v7
|
2023-10-18 09:52:48 +00:00
|
|
|
- linux/arm64/v8
|
|
|
|
- linux/riscv64
|
2020-11-14 15:28:50 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-10-13 08:03:02 +00:00
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
2023-10-18 09:52:48 +00:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2023-10-13 08:03:02 +00:00
|
|
|
|
2023-10-18 09:52:48 +00:00
|
|
|
- name: Login to Container Registry
|
|
|
|
uses: docker/login-action@v3
|
2023-10-13 08:03:02 +00:00
|
|
|
with:
|
2024-03-28 13:18:28 +00:00
|
|
|
registry: git.kmsign.ru
|
2023-10-13 08:03:02 +00:00
|
|
|
username: ${{ github.actor }}
|
2024-03-28 22:48:58 +00:00
|
|
|
password: ${{ PACKAGE_TOKEN }}
|
2020-11-14 15:28:50 +00:00
|
|
|
|
|
|
|
- name: Docker meta
|
2021-04-04 19:00:21 +00:00
|
|
|
id: meta
|
2024-03-28 14:27:38 +00:00
|
|
|
uses: https://github.com/docker/metadata-action@v5
|
2020-11-14 15:28:50 +00:00
|
|
|
with:
|
2023-10-13 08:03:02 +00:00
|
|
|
# list of Docker images to use as base name for tags
|
2024-03-28 13:18:28 +00:00
|
|
|
images: git.kmsign.ru/${{ github.repository }}
|
2023-10-13 08:03:02 +00:00
|
|
|
# generate Docker tags based on the following events/attributes
|
2021-04-04 19:00:21 +00:00
|
|
|
tags: |
|
2023-10-13 08:03:02 +00:00
|
|
|
type=schedule
|
2021-04-04 19:00:21 +00:00
|
|
|
type=ref,event=branch
|
|
|
|
type=ref,event=pr
|
|
|
|
type=semver,pattern={{version}}
|
|
|
|
type=semver,pattern={{major}}.{{minor}}
|
2023-10-13 08:03:02 +00:00
|
|
|
type=semver,pattern={{major}}
|
|
|
|
type=sha
|
2020-11-14 15:28:50 +00:00
|
|
|
|
2023-10-13 08:03:02 +00:00
|
|
|
- name: Build and push Docker image
|
2023-10-18 09:52:48 +00:00
|
|
|
uses: docker/build-push-action@v5
|
2020-11-14 15:28:50 +00:00
|
|
|
with:
|
2021-04-04 19:00:21 +00:00
|
|
|
context: .
|
2023-10-13 08:03:02 +00:00
|
|
|
push: true
|
|
|
|
pull: true
|
|
|
|
platforms: ${{ matrix.platform }}
|
2021-04-04 19:00:21 +00:00
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|
2023-10-13 08:03:02 +00:00
|
|
|
sbom: true
|
|
|
|
provenance: true
|
2024-03-28 13:18:28 +00:00
|
|
|
# cache-from: type=gha
|
|
|
|
# cache-to: type=gha,mode=max
|
2023-10-13 08:03:02 +00:00
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|