-
Notifications
You must be signed in to change notification settings - Fork 2
140 lines (124 loc) · 4.24 KB
/
build-and-push.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
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
---
name: Build
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
merge_group:
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
env:
REGISTRY: ghcr.io
jobs:
build-c2-build:
name: "Build ${{ matrix.image-name }} builder"
runs-on: ubuntu-latest
strategy:
matrix:
include:
# The Dockerfile file name will be inferred from the image-name parameter
# If the image-name is chatterino2-xd, the Dockerfile it will look for is Dockerfile_chatterino2-xd
- os: ubuntu-20.04
image-name: chatterino2-build-ubuntu-20.04
- os: ubuntu-22.04
image-name: chatterino2-build-ubuntu-22.04
- os: ubuntu-24.04
image-name: chatterino2-build-ubuntu-24.04
env:
C2_PLUGINS: "ON"
C2_BUILD_WITH_QT6: "ON"
IMAGE_NAME: "chatterino/${{ matrix.image-name }}"
steps:
- uses: actions/checkout@v4
with:
repository: "Chatterino/chatterino2"
submodules: recursive
- uses: actions/checkout@v4
with:
path: "chatterino-docker"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log into docker registry
if: github.event_name == 'push'
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build docker image
uses: docker/build-push-action@v5
with:
context: .
push: false
load: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
file: ./chatterino-docker/Dockerfile_${{ matrix.image-name }}
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}
cache-to: type=inline
# Build Chatterino master with this docker image
- name: Test docker image
run: |
docker run \
-v "${PWD}:/srv" \
-w"/srv" \
-e C2_PLUGINS \
-e C2_BUILD_WITH_QT6 \
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} \
./.CI/full-ubuntu-build.sh
- name: Push docker image
if: github.event_name == 'push'
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
file: ./chatterino-docker/Dockerfile_${{ matrix.image-name }}
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}
cache-to: type=inline
build-c2-generic:
name: "Build ${{ matrix.image-name }} generic"
runs-on: ubuntu-latest
strategy:
matrix:
include:
# The Dockerfile file name will be inferred from the image-name parameter
# If the image-name is chatterino2-xd, the Dockerfile it will look for is Dockerfile_chatterino2-xd
- image-name: chatterino2-test-httpbox
env:
IMAGE_NAME: "chatterino/${{ matrix.image-name }}"
steps:
- uses: actions/checkout@v4
with:
path: "chatterino-docker"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log into docker registry
if: github.event_name == 'push'
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build docker image
uses: docker/build-push-action@v5
with:
context: .
push: false
load: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
file: ./chatterino-docker/Dockerfile_${{ matrix.image-name }}
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}
cache-to: type=inline
- name: Push docker image
if: github.event_name == 'push'
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
file: ./chatterino-docker/Dockerfile_${{ matrix.image-name }}
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}
cache-to: type=inline