GitHub workflow to build and publish Docker images

pull/5308/head
Richard Hansen 2021-11-29 21:02:41 -05:00
parent df459c1278
commit 40854b0cfd
1 changed files with 36 additions and 0 deletions

36
.github/workflows/docker.yml vendored Normal file
View File

@ -0,0 +1,36 @@
name: Docker
on:
push:
branches:
- 'develop'
tags:
- 'v?[0-9]+.[0-9]+.[0-9]+'
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v2
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: etherpad/etherpad
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Log in to Docker Hub
if: github.event_name != 'pull_request'
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: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}