-
Notifications
You must be signed in to change notification settings - Fork 55
110 lines (95 loc) · 3.05 KB
/
docker.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# GitHub actions workflow which builds and publishes the docker images.
name: Build and deploy docker images
on:
push:
branches: [develop]
schedule:
- cron: 0 1 * * * # 1am, daily.
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-sytest-images:
name: "Build sytest:${{ matrix.tag }}"
runs-on: ubuntu-latest
strategy:
matrix:
include:
- base_image: ubuntu:focal
tag: focal
- base_image: debian:buster
tag: buster
- base_image: debian:testing
tag: testing
steps:
- name: Set up QEMU
id: QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Inspect builder
run: docker buildx inspect
- name: Log in to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
pull: true
push: true
platforms: linux/amd64,linux/arm64
labels: "gitsha1=${{ github.sha }}"
file: docker/base.Dockerfile
build-args: "BASE_IMAGE=${{ matrix.base_image }}"
tags: matrixdotorg/sytest:${{ matrix.tag }}
build-dependent-images:
needs: build-sytest-images
name: "Build sytest-${{ matrix.dockerfile }}:${{ matrix.sytest_image_tag }}"
runs-on: ubuntu-latest
strategy:
matrix:
include:
- sytest_image_tag: focal
dockerfile: synapse
tags: "matrixdotorg/sytest-synapse:focal"
build_args: "SYTEST_IMAGE_TAG=focal"
- sytest_image_tag: buster
dockerfile: synapse
tags: "matrixdotorg/sytest-synapse:buster"
build_args: "SYTEST_IMAGE_TAG=buster"
- sytest_image_tag: testing
dockerfile: synapse
tags: "matrixdotorg/sytest-synapse:testing"
build_args: |
SYTEST_IMAGE_TAG=testing
SYSTEM_PIP_INSTALL_SUFFIX=--break-system-packages
steps:
- name: Set up QEMU
id: QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Inspect builder
run: docker buildx inspect
- name: Log in to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
pull: true
push: true
platforms: linux/amd64,linux/arm64
labels: "gitsha1=${{ github.sha }}"
file: docker/${{ matrix.dockerfile }}.Dockerfile
build-args: ${{ matrix.build_args }}
tags: ${{ matrix.tags }}