Skip to content
This repository was archived by the owner on Aug 7, 2023. It is now read-only.

Commit f68a7f1

Browse files
committed
feature: build+push workflow actions
1 parent 4cbb725 commit f68a7f1

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

.github/workflows/release.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ jobs:
1212
steps:
1313
- name: Checkout
1414
uses: actions/checkout@v2
15+
- name: Set outputs
16+
id: vars
17+
run: |
18+
echo "::set-output name=latest_tag::$(git describe --tags $(git rev-list --tags --max-count=1))"
19+
echo "::set-output name=build_time::$(date -u +'%m-%d-%YT%H:%M:%SZ')"
20+
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
1521
- name: Set up Go
1622
uses: actions/setup-go@v2
1723
with:
@@ -22,4 +28,18 @@ jobs:
2228
version: latest
2329
args: release --rm-dist
2430
env:
25-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
- name: Login to DockerHub
33+
uses: docker/login-action@v1
34+
with:
35+
username: ${{ secrets.DOCKERHUB_USERNAME }}
36+
password: ${{ secrets.DOCKERHUB_TOKEN }}
37+
- name: Build and push
38+
id: docker_build
39+
uses: docker/build-push-action@v2
40+
with:
41+
push: true
42+
tags: trendyoltech/certificator:${{ steps.vars.outputs.latest_tag }}
43+
build-args: |
44+
BUILD_TIME=${{ steps.vars.outputs.build_time }}
45+
VCS_REF=${{ steps.vars.outputs.sha_short }}

0 commit comments

Comments
 (0)