-
Notifications
You must be signed in to change notification settings - Fork 2
143 lines (126 loc) · 4.66 KB
/
docker.yaml
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: Docker Images
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
on:
push:
paths:
- ".github/workflows/*.yaml"
- "Dockerfile"
env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}
TARGET_PLATFORMS: linux/amd64,linux/arm64
LATEST_SUSHI: "3.11.0"
MAIN_OS: "alpine"
jobs:
sushi:
name: FSH Sushi
runs-on: ubuntu-latest
strategy:
matrix:
os: [alpine, ubuntu]
sushi: ["2.10.2", "3.0.0", "3.5.0", "3.10.0", "3.11.0", "3.11.1"]
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Adds static libs for multi-platform builds
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3
with:
platforms: ${{ env.TARGET_PLATFORMS }}
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/fsh-sushi
tags: |
type=raw,value=${{ matrix.sushi }}-${{ matrix.os }}
type=raw,value=${{ matrix.sushi }},enable=${{ matrix.os == env.MAIN_OS }}
type=raw,value=latest,enable=${{ matrix.sushi == env.LATEST_SUSHI && matrix.os == env.MAIN_OS }}
# Build and push Docker image with Buildx (push on tag)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v5
with:
push: ${{ github.ref_name == 'main'}}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
target: fsh-sushi-${{ matrix.os }}
build-args: SUSHI_VERSION=${{ matrix.sushi }}
ig-publisher:
name: IG Publisher
needs: sushi
runs-on: ubuntu-latest
strategy:
matrix:
os: [alpine, ubuntu]
sushi: ["2.10.2", "3.0.0", "3.5.0", "3.10.0", "3.11.0", "3.11.1"]
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Adds static libs for multi-platform builds
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3
with:
platforms: ${{ env.TARGET_PLATFORMS }}
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/ig-publisher
tags: |
type=raw,value=${{ matrix.sushi }}-${{ matrix.os }}
type=raw,value=${{ matrix.sushi }},enable=${{ matrix.os == env.MAIN_OS }}
type=raw,value=latest,enable=${{ matrix.sushi == env.LATEST_SUSHI && matrix.os == env.MAIN_OS }}
# Build and push Docker image with Buildx (push on tag)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v5
with:
push: ${{ github.ref_name == 'main'}}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
target: ig-publisher-${{ matrix.os }}
build-args: SUSHI_VERSION=${{ matrix.sushi }}