Skip to content

docker

docker #224

Workflow file for this run

---
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:
fail-fast: false
matrix:
image: [alpine-s390x, bazel, bazel-cache, compcert, doxygen, flutter-web, frama-c, freebsd, haskell, pkgsrc]
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout code
uses: actions/checkout@v4
- 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@v5
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:
strategy:
matrix:
image: [server, worker]
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: "{{defaultContext}}:buildfarm"
file: ${{ matrix.image }}.Dockerfile
tags: toxchat/buildfarm-${{ matrix.image }}:latest
cache-from: type=registry,ref=toxchat/buildfarm-${{ matrix.image }}:latest
cache-to: type=inline
push: ${{ github.event_name == 'push' }}
##################################################
#
# :: GHC for Android
#
##################################################
ghc-base:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout code
uses: actions/checkout@v4
- name: Generate configs
run: cd ghc && ./configure
- name: Build and push
uses: docker/build-push-action@v5
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@v3
- name: Login to DockerHub
if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout code
uses: actions/checkout@v4
- name: Generate configs
run: cd ghc-android && ./configure
- name: Build and push
uses: docker/build-push-action@v5
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' }}