12 name: Generate matrix for Docker build
13 runs-on: ubuntu-latest
15 matrix: ${{ steps.set-matrix.outputs.matrix }}
18 uses: actions/checkout@v3
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\", \"platforms\": \"linux/amd64\" }"
28 two="{ \"file\": \"./support/docker/production/Dockerfile.bullseye\", \"ref\": \"develop\", \"tags\": \"chocobozzz/peertube:develop-bullseye\", \"platforms\": \"linux/arm64\" }"
29 three="{ \"file\": \"./support/docker/production/Dockerfile.bullseye\", \"ref\": \"master\", \"tags\": \"chocobozzz/peertube:production-bullseye,chocobozzz/peertube:$(git describe --abbrev=0)-bullseye\", \"platforms\": \"linux/amd64\" }"
30 four="{ \"file\": \"./support/docker/production/Dockerfile.bullseye\", \"ref\": \"master\", \"tags\": \"chocobozzz/peertube:production-bullseye,chocobozzz/peertube:$(git describe --abbrev=0)-bullseye\", \"platforms\": \"linux/arm64\" }"
31 five="{ \"file\": \"./support/docker/production/Dockerfile.nginx\", \"ref\": \"master\", \"tags\": \"chocobozzz/peertube-webserver:latest\", \"platforms\": \"linux/amd64,linux/arm64\" }"
33 matrix="[$one,$two,$three,$four,$five]"
34 echo "matrix={\"include\":$matrix}" >> $GITHUB_OUTPUT
37 runs-on: ubuntu-latest
39 needs: generate-matrix
42 matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
45 name: ${{ matrix.tags }}
50 uses: docker/setup-qemu-action@v2
52 name: Set up Docker Buildx
53 uses: docker/setup-buildx-action@v2
55 name: Login to DockerHub
56 uses: docker/login-action@v2
58 username: ${{ secrets.DOCKERHUB_USERNAME }}
59 password: ${{ secrets.DOCKERHUB_TOKEN }}
62 name: Checkout develop
63 uses: actions/checkout@v3
65 ref: ${{ matrix.ref }}
68 uses: docker/build-push-action@v3
71 platforms: ${{ matrix.platforms }}
73 file: ${{ matrix.file }}
74 tags: ${{ matrix.tags }}