-
Notifications
You must be signed in to change notification settings - Fork 347
84 lines (78 loc) · 2.3 KB
/
release.docker.yml
File metadata and controls
84 lines (78 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
on:
release:
types:
- published
# pull_request:
# types:
# - opened
# - synchronize
# - reopened
# branches-ignore:
# - "dependabot/**"
name: Release (Docker)
jobs:
docker:
runs-on: ubuntu-latest
env:
# CGO cross-compilation supported platforms
PLATFORMS: "linux/amd64,linux/arm64"
VERSION: "${{ github.event_name == 'release' && github.event.release.tag_name || github.sha }}"
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
username: benbjohnson
password: ${{ secrets.DOCKERHUB_TOKEN }}
# Default (Debian) image
- id: meta-default
uses: docker/metadata-action@v5
with:
images: litestream/litestream
tags: |
type=ref,event=branch
type=ref,event=pr
type=sha
type=sha,format=long
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- uses: docker/build-push-action@v6
with:
context: .
target: default
push: true
provenance: true
sbom: true
platforms: ${{ env.PLATFORMS }}
tags: ${{ steps.meta-default.outputs.tags }}
labels: ${{ steps.meta-default.outputs.labels }}
build-args: |
LITESTREAM_VERSION=${{ env.VERSION }}
# Hardened (Scratch) image
- id: meta-scratch
uses: docker/metadata-action@v5
with:
images: litestream/litestream
flavor: |
latest=auto
suffix=-scratch
tags: |
type=ref,event=branch
type=ref,event=pr
type=sha
type=sha,format=long
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- uses: docker/build-push-action@v6
with:
context: .
target: hardened
push: true
provenance: true
sbom: true
platforms: ${{ env.PLATFORMS }}
tags: ${{ steps.meta-scratch.outputs.tags }}
labels: ${{ steps.meta-scratch.outputs.labels }}
build-args: |
LITESTREAM_VERSION=${{ env.VERSION }}