]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - .github/workflows/docker.yml
Fix docker ci matrix
[github/Chocobozzz/PeerTube.git] / .github / workflows / docker.yml
1 name: Docker
2
3 on:
4 push:
5 branches:
6 - 'master'
7 schedule:
8 - cron: '0 3 * * *'
9
10 jobs:
11 generate-matrix:
12 name: Generate matrix for Docker build
13 runs-on: ubuntu-latest
14 outputs:
15 matrix: ${{ steps.set-matrix.outputs.matrix }}
16 steps:
17 - name: Checkout
18 uses: actions/checkout@v3
19 with:
20 ref: master
21 - name: Set matrix for build
22 id: set-matrix
23 run: |
24 # FIXME: https://github.com/actions/checkout/issues/290
25 git fetch --force --tags
26
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\" }"
32
33 matrix="[$one,$two,$three,$four,$five]"
34 echo "matrix={\"include\":$matrix}" >> $GITHUB_OUTPUT
35
36 docker:
37 runs-on: ubuntu-latest
38
39 needs: generate-matrix
40
41 strategy:
42 matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
43 fail-fast: false
44
45 name: ${{ matrix.tags }}
46
47 steps:
48 -
49 name: Set up QEMU
50 uses: docker/setup-qemu-action@v2
51 -
52 name: Set up Docker Buildx
53 uses: docker/setup-buildx-action@v2
54 -
55 name: Login to DockerHub
56 uses: docker/login-action@v2
57 with:
58 username: ${{ secrets.DOCKERHUB_USERNAME }}
59 password: ${{ secrets.DOCKERHUB_TOKEN }}
60
61 -
62 name: Checkout develop
63 uses: actions/checkout@v3
64 with:
65 ref: ${{ matrix.ref }}
66 -
67 name: Docker build
68 uses: docker/build-push-action@v3
69 with:
70 context: '.'
71 platforms: ${{ matrix.platforms }}
72 push: true
73 file: ${{ matrix.file }}
74 tags: ${{ matrix.tags }}