12 name: Generate matrix for Docker build
13 runs-on: ubuntu-latest
15 matrix: ${{ steps.set-matrix.outputs.matrix }}
18 uses: actions/checkout@v2
21 - name: Set matrix for build
24 # FIXME: https://github.com/actions/checkout/issues/290
25 git fetch --force --tags
27 one="{ \"file\": \"./support/docker/production/Dockerfile.bullseye\", \"ref\": \"develop\", \"tags\": \"chocobozzz/peertube:develop-bullseye\" }"
28 two="{ \"file\": \"./support/docker/production/Dockerfile.buster\", \"ref\": \"master\", \"tags\": \"chocobozzz/peertube:production-buster,chocobozzz/peertube:$(git describe --abbrev=0)-buster\" }"
29 three="{ \"file\": \"./support/docker/production/Dockerfile.nginx\", \"ref\": \"master\", \"tags\": \"chocobozzz/peertube-webserver:latest\" }"
31 matrix="[$one,$two,$three]"
32 echo ::set-output name=matrix::{\"include\":$(echo $matrix)}
35 runs-on: ubuntu-latest
37 needs: generate-matrix
40 matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
46 uses: docker/setup-qemu-action@v1
48 name: Set up Docker Buildx
49 uses: docker/setup-buildx-action@v1
51 name: Login to DockerHub
52 uses: docker/login-action@v1
54 username: ${{ secrets.DOCKERHUB_USERNAME }}
55 password: ${{ secrets.DOCKERHUB_TOKEN }}
58 name: Checkout develop
59 uses: actions/checkout@v2
61 ref: ${{ matrix.ref }}
64 uses: docker/build-push-action@v2
67 platforms: linux/amd64,linux/arm64
69 file: ${{ matrix.file }}
70 tags: ${{ matrix.tags }}