Skip to content
This repository was archived by the owner on May 14, 2025. It is now read-only.

Commit 6704701

Browse files
authored
fix: Release docker image on release tags (#116)
Signed-off-by: grzesuav <grzesuav@gmail.com>
1 parent 2792005 commit 6704701

File tree

2 files changed

+42
-18
lines changed

2 files changed

+42
-18
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
name: Release docker image
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+.[0-9]+.[0-9]+'
7+
jobs:
8+
tests:
9+
runs-on: ubuntu-18.04
10+
strategy:
11+
matrix:
12+
test: ['unit-test', 'integration-test']
13+
name: ${{ matrix.test }}
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
- name: setup env
18+
run: |
19+
echo "::set-env name=GOPATH::$(go env GOPATH)"
20+
echo "::add-path::$(go env GOPATH)/bin"
21+
- name: Setup go
22+
uses: actions/setup-go@v1
23+
with:
24+
go-version: 1.13.5
25+
- run: make ${{ matrix.test }}
26+
release-docker:
27+
name: Release docker image
28+
runs-on: ubuntu-18.04
29+
needs: ['tests']
30+
if: startsWith(github.ref, 'refs/tags/v')
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v2
34+
- name: Deploy docker image
35+
uses: docker/build-push-action@v1
36+
with:
37+
username: ${{ secrets.DOCKER_USERNAME }}
38+
password: ${{ secrets.DOCKER_PASSWORD }}
39+
repository: quay.io/amitkumardas/metac
40+
registry: quay.io
41+
tag_with_ref: true
42+
add_git_labels: true

.github/workflows/test-release.yaml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,3 @@ jobs:
3838
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3939
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4040
run: npx semantic-release
41-
release-docker:
42-
name: Release docke rimage
43-
runs-on: ubuntu-18.04
44-
needs: ['tests']
45-
if: startsWith(github.ref, 'refs/tags/')
46-
steps:
47-
- name: Checkout
48-
uses: actions/checkout@v2
49-
- name: Deploy docker image
50-
uses: docker/build-push-action@v1
51-
with:
52-
username: ${{ secrets.DOCKER_USERNAME }}
53-
password: ${{ secrets.DOCKER_PASSWORD }}
54-
repository: quay.io/amitkumardas/metac
55-
registry: quay.io
56-
tag_with_ref: true
57-
add_git_labels: true
58-
push: ${{ startsWith(github.ref, 'refs/tags/') }}

0 commit comments

Comments
 (0)