2021-10-17 14:12:39 +02:00
|
|
|
name: docker
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'master'
|
2021-10-17 15:36:43 +02:00
|
|
|
tags:
|
|
|
|
- 'v*'
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- 'master'
|
2021-10-17 14:12:39 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
docker:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-10-17 14:28:40 +02:00
|
|
|
-
|
|
|
|
name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
2021-10-17 14:12:39 +02:00
|
|
|
-
|
|
|
|
name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v1
|
2021-10-17 22:18:20 +02:00
|
|
|
with:
|
|
|
|
platforms: amd64,arm64
|
2021-10-17 14:12:39 +02:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
2021-10-17 15:36:43 +02:00
|
|
|
-
|
|
|
|
name: Docker meta
|
|
|
|
id: meta
|
|
|
|
uses: docker/metadata-action@v3
|
|
|
|
with:
|
2021-10-17 22:42:00 +02:00
|
|
|
images: 42wim/matterbridge,ghcr.io/42wim/matterbridge
|
2021-10-17 15:48:37 +02:00
|
|
|
flavor: |
|
|
|
|
latest=true
|
2021-10-17 15:36:43 +02:00
|
|
|
tags: |
|
|
|
|
type=ref,event=branch
|
|
|
|
type=ref,event=pr
|
|
|
|
type=semver,pattern={{version}}
|
|
|
|
type=semver,pattern=stable
|
|
|
|
type=semver,pattern={{major}}
|
|
|
|
type=semver,pattern={{major}}.{{minor}}
|
2021-10-17 14:12:39 +02:00
|
|
|
-
|
|
|
|
name: Login to DockerHub
|
|
|
|
uses: docker/login-action@v1
|
2021-10-17 15:37:55 +02:00
|
|
|
if: github.event_name != 'pull_request'
|
2021-10-17 14:12:39 +02:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
2021-10-17 22:42:00 +02:00
|
|
|
-
|
2021-10-17 22:18:20 +02:00
|
|
|
name: Log into registry ghcr.io
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
if: github.event_name != 'pull_request'
|
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.repository_owner }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
2021-10-17 14:12:39 +02:00
|
|
|
-
|
|
|
|
name: Build and push
|
|
|
|
id: docker_build
|
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
2021-10-17 14:28:40 +02:00
|
|
|
context: .
|
2021-10-17 22:18:20 +02:00
|
|
|
platforms: linux/amd64,linux/arm64
|
2021-10-17 15:36:43 +02:00
|
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|
2021-10-17 14:12:39 +02:00
|
|
|
|