tstor/.github/workflows/docker.yaml

66 lines
1.7 KiB
YAML
Raw Normal View History

name: docker
on:
push:
2023-10-08 16:46:03 +00:00
branches:
- master
tags:
2023-10-08 16:46:03 +00:00
- "v*"
jobs:
2023-10-13 08:03:02 +00:00
build-docker:
strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
- linux/arm64
- linux/386
- inux/arm/v6
- linux/arm/v7
- linux/arm64
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-17 18:47:25 +00:00
uses: docker/setup-buildx-action@v3
2023-10-13 08:03:02 +00:00
- name: Login to GitHub Container Registry
2023-10-17 18:47:25 +00:00
uses: docker/login-action@v3
2023-10-13 08:03:02 +00:00
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
2021-04-04 19:00:21 +00:00
id: meta
2023-10-13 08:03:02 +00:00
uses: docker/metadata-action@v5
with:
2023-10-13 08:03:02 +00:00
# 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
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
2023-10-13 08:03:02 +00:00
- name: Build and push Docker image
2023-10-17 18:47:25 +00:00
uses: docker/build-push-action@v5
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
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.meta.outputs.tags }}