matterbridge/.github/workflows/docker.yml

58 lines
1.4 KiB
YAML
Raw Normal View History

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
-
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:
images: 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 }}
-
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 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