37 lines
1.0 KiB
YAML
37 lines
1.0 KiB
YAML
|
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 }}
|