|
|
@ -1,23 +1,38 @@
|
|
|
|
|
|
|
|
# Reference: https://github.com/docker/build-push-action/blob/master/docs/advanced/tags-labels.md
|
|
|
|
|
|
|
|
|
|
|
|
name: "Docker Publish"
|
|
|
|
name: "Docker Publish"
|
|
|
|
|
|
|
|
|
|
|
|
on:
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
tags:
|
|
|
|
- "v*"
|
|
|
|
- "v*.*.*"
|
|
|
|
workflow_dispatch:
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
jobs:
|
|
|
|
dockerize:
|
|
|
|
dockerize:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Checkout
|
|
|
|
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Docker meta
|
|
|
|
|
|
|
|
id: meta
|
|
|
|
|
|
|
|
uses: docker/metadata-action@v3
|
|
|
|
|
|
|
|
with:
|
|
|
|
|
|
|
|
images: moonrailgun/tailchat
|
|
|
|
|
|
|
|
# generate Docker tags based on the following events/attributes
|
|
|
|
|
|
|
|
tags: |
|
|
|
|
|
|
|
|
type=ref,event=branch
|
|
|
|
|
|
|
|
type=ref,event=pr
|
|
|
|
|
|
|
|
type=semver,pattern={{version}}
|
|
|
|
|
|
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
|
|
|
|
|
|
type=semver,pattern={{major}}
|
|
|
|
|
|
|
|
type=sha
|
|
|
|
- name: Set up QEMU
|
|
|
|
- name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
- name: Get version
|
|
|
|
|
|
|
|
id: get_version
|
|
|
|
|
|
|
|
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
|
|
|
|
|
|
|
|
- name: Login to DockerHub
|
|
|
|
- name: Login to DockerHub
|
|
|
|
|
|
|
|
if: github.event_name != 'pull_request'
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
@ -25,5 +40,7 @@ jobs:
|
|
|
|
- name: Build and push
|
|
|
|
- name: Build and push
|
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
|
|
|
with:
|
|
|
|
push: true
|
|
|
|
context: .
|
|
|
|
tags: moonrailgun/tailchat:${{ steps.get_version.outputs.VERSION }}
|
|
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
|
|
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
|
|