forked from infiniteproject/liquidsoap
-
Notifications
You must be signed in to change notification settings - Fork 4
95 lines (93 loc) · 2.65 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: build
on:
push:
branches:
- master
paths:
- Dockerfile
- .github/workflows/build.yml
pull_request:
branches:
- master
paths:
- Dockerfile
- .github/workflows/build.yml
repository_dispatch:
types:
- upstream_image_update
jobs:
docker:
runs-on: ubuntu-latest
permissions:
packages: write
env:
TITLE: Liquidsoap
GHCR_SLUG: ghcr.io/phasecorex/liquidsoap
DOCK_SLUG: docker.io/phasecorex/liquidsoap
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.GHCR_SLUG }}
${{ env.DOCK_SLUG }}
labels: |
maintainer=${{ github.repository_owner }}
org.opencontainers.image.vendor=${{ github.repository_owner }}
org.opencontainers.image.title=${{ env.TITLE }}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v6
with:
platforms: |
linux/amd64
linux/arm/v7
linux/arm64
linux/386
push: ${{ github.event_name != 'pull_request' }}
tags: |
${{ env.GHCR_SLUG }}:latest
${{ env.DOCK_SLUG }}:latest
cache-from: |
${{ env.GHCR_SLUG }}:latest
labels: ${{ steps.meta.outputs.labels }}
-
name: Check manifest
if: github.event_name != 'pull_request'
run: |
docker buildx imagetools inspect ${{ env.GHCR_SLUG }}:latest
docker buildx imagetools inspect ${{ env.DOCK_SLUG }}:latest
-
name: Check pull
if: github.event_name != 'pull_request'
run: |
docker pull ${{ env.GHCR_SLUG }}:latest
docker image inspect ${{ env.GHCR_SLUG }}:latest
docker pull ${{ env.DOCK_SLUG }}:latest
docker image inspect ${{ env.DOCK_SLUG }}:latest