-
Notifications
You must be signed in to change notification settings - Fork 4
166 lines (157 loc) · 5.35 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
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
---
name: docker
# Run on push and once a week to keep the images from bitrotting and to
# identify issues while no commits are being pushed.
on:
push:
branches: [master]
pull_request:
branches: [master]
schedule:
- cron: "52 2 * * 0"
# Cancel old PR builds when pushing new commits.
concurrency:
group: build-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
matrix:
image: [alpine-s390x, bazel, bazel-cache, flutter-web, frama-c, freebsd, haskell]
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout code
uses: actions/checkout@v3
- name: Build image
if: hashFiles('${{ matrix.image }}/build.sh') != ''
run: |
cd ${{ matrix.image }} && [ ! -e build.sh ] || ./build.sh
- name: Build and push
uses: docker/build-push-action@v4
with:
context: "${{ matrix.image }}"
tags: toxchat/${{ matrix.image }}:latest
cache-from: type=registry,ref=toxchat/${{ matrix.image }}:latest
cache-to: type=inline
push: ${{ github.event_name == 'push' }}
# buildfarm-base:
# runs-on: ubuntu-latest
# steps:
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v2
# - name: Login to DockerHub
# uses: docker/login-action@v2
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: Build and push
# uses: docker/build-push-action@v4
# with:
# context: "{{defaultContext}}:buildfarm/base"
# push: true
# tags: toxchat/buildfarm-base:latest
# cache-from: type=registry,ref=toxchat/buildfarm-base:latest
# cache-to: type=inline
# buildfarm-server:
# runs-on: ubuntu-latest
# needs: [buildfarm-base]
# steps:
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v2
# - name: Login to DockerHub
# uses: docker/login-action@v2
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: Build and push
# uses: docker/build-push-action@v4
# with:
# context: "{{defaultContext}}:buildfarm/server"
# push: true
# tags: toxchat/buildfarm-server:latest
# cache-from: type=registry,ref=toxchat/buildfarm-server:latest
# cache-to: type=inline
# buildfarm-worker:
# runs-on: ubuntu-latest
# needs: [buildfarm-base, builder]
# steps:
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v2
# - name: Login to DockerHub
# uses: docker/login-action@v2
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: Build and push
# uses: docker/build-push-action@v4
# with:
# context: "{{defaultContext}}:buildfarm/worker"
# push: true
# tags: toxchat/buildfarm-worker:latest
# cache-from: type=registry,ref=toxchat/buildfarm-worker:latest
# cache-to: type=inline
##################################################
#
# :: GHC for Android
#
##################################################
ghc-base:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout code
uses: actions/checkout@v3
- name: Generate configs
run: cd ghc && ./configure
- name: Build and push
uses: docker/build-push-action@v4
with:
context: "ghc/base"
tags: toktoknet/ghc:8.10.7
cache-from: type=registry,ref=toktoknet/ghc:8.10.7
cache-to: type=inline
push: ${{ github.event_name == 'push' }}
ghc-android:
strategy:
matrix:
target: [aarch64, arm]
# basic.c:356:16: error: inline assembly requires more registers than available
#target: [aarch64, arm, i686, x86_64]
runs-on: ubuntu-latest
needs: [ghc-base]
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout code
uses: actions/checkout@v3
- name: Generate configs
run: cd ghc-android && ./configure
- name: Build and push
uses: docker/build-push-action@v4
with:
context: "ghc-android/${{ matrix.target }}"
tags: toktoknet/ghc-android:8.10.7.${{ matrix.target }}
cache-from: type=registry,ref=toktoknet/ghc-android:8.10.7.${{ matrix.target }}
cache-to: type=inline
push: ${{ github.event_name == 'push' }}