mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-27 00:33:10 -06:00
It looks like the docker-container buildx driver can't see host images, but if we put the image on the local registry things should (fingers crossed) work out OK. Load and push cannot happen at the same time
50 lines
1.6 KiB
YAML
50 lines
1.6 KiB
YAML
name: "(Cross) Compile Dendrite"
|
|
|
|
# dummy
|
|
on: push
|
|
|
|
jobs:
|
|
compile:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
target: [amd64, arm64, arm]
|
|
env:
|
|
GOARCH: ${{ matrix.target }}
|
|
BUILDER_IMAGE_NAME: "dendrite-builder"
|
|
DOCKER_HUB_USER: dendritegithub
|
|
services:
|
|
registry:
|
|
image: registry:2
|
|
ports:
|
|
- 5000:5000
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: set docker target
|
|
run: echo "DOCKER_TARGET=$(./.github/workflows/get-compiler.sh docker)" >> $GITHUB_ENV
|
|
- name: set docker image tag
|
|
run: echo "BUILDER_IMAGE_TAG=${DOCKER_TARGET}/${BUILDER_IMAGE_NAME}:latest" >> $GITHUB_ENV
|
|
- uses: docker/setup-qemu-action@v1
|
|
- uses: docker/setup-buildx-action@v1
|
|
with:
|
|
driver-opts: network=host
|
|
- name: build dendrite in Docker
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
context: .
|
|
file: ./.github/workflows/Dockerfile.builder
|
|
push: true
|
|
tags: "localhost:5000/${{ env.BUILDER_IMAGE_TAG }}"
|
|
build-args: "GOARCH=${{ env.GOARCH }}"
|
|
# - run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
|
- run: docker image inspect "${{ env.BUILDER_IMAGE_TAG }}"
|
|
- name: build monolith
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
context: .
|
|
file: ./.github/workflows/Dockerfile.copyin
|
|
platforms: ${{ env.DOCKER_TARGET }}
|
|
push: true
|
|
tags: localhost:5000/matrixdotorg/dendrite-monolith:latest
|
|
build-args: "builder=localhost:5000/${{ env.BUILDER_IMAGE_TAG }}\nDENDRITE_BINARY=dendrite-monolith-server"
|