-
-
Notifications
You must be signed in to change notification settings - Fork 41
77 lines (75 loc) · 2.99 KB
/
build.yml
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
name: Build
on:
push:
branches:
- '*'
tags:
- 'v*.*.*'
pull_request:
branches:
- '*'
release:
types:
- published
workflow_dispatch:
jobs:
build:
name: "Build ${{ matrix.image.name }}"
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
image:
- name: vladgh/gpg
path: gpg
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8
- name: vladgh/minidlna
path: minidlna
platforms: linux/amd64,linux/386,linux/arm/v6,linux/arm/v7,linux/arm64/v8
- name: vladgh/s3sync
path: s3sync
platforms: linux/amd64
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Detect changes
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
filters: |
build:
- ${{ matrix.image.path }}/!(**.md)
- name: Docker Metadata
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
id: meta
if: steps.filter.outputs.build == 'true' || ( github.event_name == 'release' && github.event.action == 'published' )
with:
images: ${{ matrix.image.name }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }}
type=sha
- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
if: steps.filter.outputs.build == 'true' || ( github.event_name == 'release' && github.event.action == 'published' )
- name: Set up Docker BuildX
uses: docker/setup-buildx-action@3d68780484996aa9d417bb9016193885cdf1f299 # v3.6.0
if: steps.filter.outputs.build == 'true' || ( github.event_name == 'release' && github.event.action == 'published' )
- name: Login to DockerHub
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
if: ( steps.filter.outputs.build == 'true' && github.event_name != 'pull_request' ) || ( github.event_name == 'release' && github.event.action == 'published' )
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@5176d81f87c23d6fc96624dfdbcd9f3830bbe445 # v6.5.0
if: steps.filter.outputs.build == 'true' || ( github.event_name == 'release' && github.event.action == 'published' )
with:
context: ${{ matrix.image.path }}
platforms: ${{ matrix.image.platforms }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: ${{ github.event_name != 'pull_request' }}