5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-10 04:20:25 +00:00
matterbridge/.github/workflows/docker.yml

69 lines
1.7 KiB
YAML
Raw Normal View History

2021-10-17 12:12:39 +00:00
name: docker
on:
push:
branches:
- 'master'
2021-10-17 13:36:43 +00:00
tags:
- 'v*'
pull_request:
branches:
- 'master'
2021-10-17 12:12:39 +00:00
jobs:
docker:
runs-on: ubuntu-latest
steps:
2021-10-17 12:28:40 +00:00
-
name: Checkout
uses: actions/checkout@v2
2021-10-17 12:12:39 +00:00
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: amd64,arm64
2021-10-17 12:12:39 +00:00
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
2021-10-17 13:36:43 +00:00
-
name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
2021-10-17 20:42:00 +00:00
images: 42wim/matterbridge,ghcr.io/42wim/matterbridge
2021-10-17 13:48:37 +00:00
flavor: |
latest=true
2021-10-17 13:36:43 +00: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 12:12:39 +00:00
-
name: Login to DockerHub
uses: docker/login-action@v1
2021-10-17 13:37:55 +00:00
if: github.event_name != 'pull_request'
2021-10-17 12:12:39 +00:00
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
2021-10-17 20:42:00 +00: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 12:12:39 +00:00
-
name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
2021-10-17 12:28:40 +00:00
context: .
platforms: linux/amd64,linux/arm64
2021-10-17 13:36:43 +00:00
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2021-10-17 12:12:39 +00:00