-
Notifications
You must be signed in to change notification settings - Fork 2
44 lines (43 loc) · 1.3 KB
/
docker-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Docker Publish
on:
release:
types: [published]
jobs:
push:
runs-on: ubuntu-latest
if: github.event_name == 'release'
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Prepare
id: prep
run: |
DOCKER_IMAGE=evotm/evosc
VERSION=${GITHUB_REF#refs/tags/}
TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:latest"
echo ::set-output name=version::${VERSION}
echo ::set-output name=tags::${TAGS}
echo ::set-output name=builddate::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
echo ::set-output name=revision::$(git rev-parse --short HEAD)
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ steps.prep.outputs.tags }}
build-args: |
BUILD_DATE=${{ steps.prep.outputs.builddate }}
REVISION=${{ steps.prep.outputs.revision }}
EVOSC_VERSION=${{ steps.prep.outputs.version }}