2021-11-30 10:00:59 -05:00
|
|
|
name: Docker
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'master'
|
|
|
|
schedule:
|
|
|
|
- cron: '0 3 * * *'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
generate-matrix:
|
|
|
|
name: Generate matrix for Docker build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2022-06-27 09:28:32 -04:00
|
|
|
uses: actions/checkout@v3
|
2021-11-30 10:00:59 -05:00
|
|
|
with:
|
|
|
|
ref: master
|
|
|
|
- name: Set matrix for build
|
|
|
|
id: set-matrix
|
|
|
|
run: |
|
|
|
|
# FIXME: https://github.com/actions/checkout/issues/290
|
|
|
|
git fetch --force --tags
|
|
|
|
|
2023-03-22 04:14:20 -04:00
|
|
|
one="{ \"file\": \"./support/docker/production/Dockerfile.bullseye\", \"ref\": \"develop\", \"tags\": \"chocobozzz/peertube:develop-bullseye\", \"platforms\": \"linux/amd64\" }"
|
|
|
|
one="{ \"file\": \"./support/docker/production/Dockerfile.bullseye\", \"ref\": \"develop\", \"tags\": \"chocobozzz/peertube:develop-bullseye\", \"platforms\": \"linux/arm64\" }"
|
|
|
|
two="{ \"file\": \"./support/docker/production/Dockerfile.bullseye\", \"ref\": \"master\", \"tags\": \"chocobozzz/peertube:production-bullseye,chocobozzz/peertube:$(git describe --abbrev=0)-bullseye\", \"platforms\": \"linux/amd64\" }"
|
|
|
|
two="{ \"file\": \"./support/docker/production/Dockerfile.bullseye\", \"ref\": \"master\", \"tags\": \"chocobozzz/peertube:production-bullseye,chocobozzz/peertube:$(git describe --abbrev=0)-bullseye\", \"platforms\": \"linux/arm64\" }"
|
|
|
|
three="{ \"file\": \"./support/docker/production/Dockerfile.nginx\", \"ref\": \"master\", \"tags\": \"chocobozzz/peertube-webserver:latest\", \"platforms\": \"linux/amd64,linux/arm64\" }"
|
2021-11-30 10:00:59 -05:00
|
|
|
|
|
|
|
matrix="[$one,$two,$three]"
|
2022-11-02 03:32:57 -04:00
|
|
|
echo "matrix={\"include\":$matrix}" >> $GITHUB_OUTPUT
|
2021-11-30 10:00:59 -05:00
|
|
|
|
|
|
|
docker:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
needs: generate-matrix
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
|
|
|
|
fail-fast: false
|
|
|
|
|
2022-01-03 08:42:53 -05:00
|
|
|
name: ${{ matrix.tags }}
|
|
|
|
|
2021-11-30 10:00:59 -05:00
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Set up QEMU
|
2022-10-31 04:24:31 -04:00
|
|
|
uses: docker/setup-qemu-action@v2
|
2021-11-30 10:00:59 -05:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2022-10-31 04:24:31 -04:00
|
|
|
uses: docker/setup-buildx-action@v2
|
2021-11-30 10:00:59 -05:00
|
|
|
-
|
|
|
|
name: Login to DockerHub
|
2022-10-31 04:24:31 -04:00
|
|
|
uses: docker/login-action@v2
|
2021-11-30 10:00:59 -05:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
|
|
|
-
|
|
|
|
name: Checkout develop
|
2022-06-27 09:28:32 -04:00
|
|
|
uses: actions/checkout@v3
|
2021-11-30 10:00:59 -05:00
|
|
|
with:
|
|
|
|
ref: ${{ matrix.ref }}
|
|
|
|
-
|
|
|
|
name: Docker build
|
2022-10-31 04:24:31 -04:00
|
|
|
uses: docker/build-push-action@v3
|
2021-11-30 10:00:59 -05:00
|
|
|
with:
|
|
|
|
context: '.'
|
2023-03-22 04:14:20 -04:00
|
|
|
platforms: ${{ matrix.platforms }}
|
2021-11-30 10:00:59 -05:00
|
|
|
push: true
|
|
|
|
file: ${{ matrix.file }}
|
|
|
|
tags: ${{ matrix.tags }}
|