2021-11-30 16:00:59 +01: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 15:28:32 +02:00
|
|
|
uses: actions/checkout@v3
|
2021-11-30 16:00:59 +01: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
|
|
|
|
|
2021-12-03 10:24:33 +01:00
|
|
|
one="{ \"file\": \"./support/docker/production/Dockerfile.bullseye\", \"ref\": \"develop\", \"tags\": \"chocobozzz/peertube:develop-bullseye\" }"
|
2021-12-13 15:46:12 +01:00
|
|
|
two="{ \"file\": \"./support/docker/production/Dockerfile.bullseye\", \"ref\": \"master\", \"tags\": \"chocobozzz/peertube:production-bullseye,chocobozzz/peertube:$(git describe --abbrev=0)-bullseye\" }"
|
2021-12-03 10:24:33 +01:00
|
|
|
three="{ \"file\": \"./support/docker/production/Dockerfile.nginx\", \"ref\": \"master\", \"tags\": \"chocobozzz/peertube-webserver:latest\" }"
|
2021-11-30 16:00:59 +01:00
|
|
|
|
|
|
|
matrix="[$one,$two,$three]"
|
|
|
|
echo ::set-output name=matrix::{\"include\":$(echo $matrix)}
|
|
|
|
|
|
|
|
docker:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
needs: generate-matrix
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
|
|
|
|
fail-fast: false
|
|
|
|
|
2022-01-03 14:42:53 +01:00
|
|
|
name: ${{ matrix.tags }}
|
|
|
|
|
2021-11-30 16:00:59 +01:00
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
-
|
|
|
|
name: Login to DockerHub
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
|
|
|
-
|
|
|
|
name: Checkout develop
|
2022-06-27 15:28:32 +02:00
|
|
|
uses: actions/checkout@v3
|
2021-11-30 16:00:59 +01:00
|
|
|
with:
|
|
|
|
ref: ${{ matrix.ref }}
|
|
|
|
-
|
|
|
|
name: Docker build
|
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
|
|
|
context: '.'
|
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
push: true
|
|
|
|
file: ${{ matrix.file }}
|
|
|
|
tags: ${{ matrix.tags }}
|