docker #201
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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, compcert, 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: | |
strategy: | |
matrix: | |
image: [server, worker] | |
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: Build and push | |
uses: docker/build-push-action@v4 | |
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@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' }} |