-
-
Notifications
You must be signed in to change notification settings - Fork 0
136 lines (120 loc) · 4.42 KB
/
docker.build.yaml
File metadata and controls
136 lines (120 loc) · 4.42 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
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
name: Build
on:
schedule:
- cron: '30 11 * * *'
push:
branches-ignore:
- '**'
tags:
- 'v*.*.*'
jobs:
build:
# Downgrade due to segfault issus with qemu
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
ref: main
fetch-depth: 100
- name: Determine latest version
id: latest_version
uses: flownative/action-git-latest-release@v1
- run: |
sudo chmod -R ugo+rwX . && shopt -s dotglob && rm -rf *
- uses: actions/checkout@v4
with:
ref: ${{ steps.latest_version.outputs.tag }}
fetch-depth: 100
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
flavor: |
latest=true
images: |
flownative/redis
harbor.flownative.io/beach/redis
europe-docker.pkg.dev/flownative/docker/redis
labels: |
org.opencontainers.image.title=Redis
org.opencontainers.image.description=Docker image providing Redis
org.opencontainers.image.licenses=MIT
org.opencontainers.image.vendor=Flownative GmbH
org.opencontainers.image.version=${{ steps.latest_version.outputs.version }}
tags: |
type=semver,pattern={{major}},value=${{ steps.latest_version.outputs.version }}
type=semver,pattern={{major}}.{{minor}},value=${{ steps.latest_version.outputs.version }}
type=semver,pattern={{version}},value=${{ steps.latest_version.outputs.version }}
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v3
with:
# setup-qemu-action by default uses tonistiigi/binfmt:latest,
# which was out of date, see https://github.com/tonistiigi/binfmt/issues/165.
# Now it has been updated, but still causes segfaults.
image: tonistiigi/binfmt:qemu-v7.0.0
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_IO_REGISTRY_USER }}
password: ${{ secrets.DOCKER_IO_REGISTRY_PASSWORD }}
- name: Login to Google Artifacts Registry
uses: docker/login-action@v3
with:
registry: europe-docker.pkg.dev/flownative/docker
username: '_json_key'
password: ${{ secrets.GOOGLE_ARTIFACTS_PASSWORD_DOCKER }}
- name: Login to Harbor
uses: docker/login-action@v3
with:
registry: harbor.flownative.io
username: ${{ secrets.HARBOR_BEACH_USERNAME }}
password: ${{ secrets.HARBOR_BEACH_PASSWORD }}
- name: Build Docker image
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Send mail for Opsgenie heartbeat
uses: dawidd6/action-send-mail@v4
with:
connection_url: ${{secrets.OPSGENIE_HEARTBEAT_MAIL_CREDENTIALS}}
subject: Github Actions heartbeat ping
to: docker-build-redis@flownative.heartbeat.eu.opsgenie.net
from: Github Actions <noreply@flownative.com>
body: Build job of ${{github.repository}} completed successfully!
release-helm:
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v4
with:
ref: 'main'
fetch-depth: 100
- name: Determine latest version
id: latest_version
uses: flownative/action-git-latest-release@v1
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Release Helm chart (Harbor)
uses: flownative/action-helm-release@v2.0.1
with:
charts_folder: 'Helm'
chart_name: 'redis'
chart_version: ${{ steps.latest_version.outputs.tag }}
app_version: ${{ steps.latest_version.outputs.tag }}
registry_host: 'harbor.flownative.io'
repository_path: 'beach-charts'
repository_user: ${{ secrets.HARBOR_BEACH_CHARTS_USERNAME }}
repository_password: ${{ secrets.HARBOR_BEACH_CHARTS_PASSWORD }}