netmaker/.github/workflows/publish-docker.yml
Matthew R Kasun fbd061ac87 tags
2021-04-06 20:25:29 +00:00

56 lines
1.3 KiB
YAML

name: Publish Docker
on:
push:
branches:
- 'arm-docker'
- 'develop'
- 'main'
tags:
- 'v*.*.*'
- latest
pull_request:
branches:
- 'main'
jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Docker Meta
id: meta
uses: crazy-max/ghaction-docker-meta@v2
with:
images:
nusak/netmaker
tags: |
type=ref,event=branch
type=ref,event=pr
type=sha
type=edge,branch=develop
-
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: Build and push
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64, linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.output.tags }}
labels: ${{ steps.meta.output.labels }}