This repository has been archived by the owner on May 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (66 loc) · 2.02 KB
/
release.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Tag & Go List
on:
workflow_run:
workflows: ["Lint & Test"]
branches: [main]
types:
- completed
jobs:
release:
runs-on: ubuntu-22.04
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
outputs:
version: ${{ steps.semantic.outputs.release-version }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- name: Set up cache
uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Tag
uses: codfish/semantic-release-action@v2.0.0
id: semantic
with:
branches: |
['main']
tag_format: "v${version}"
additional_packages: |
['@semantic-release/commit-analyzer']
plugins: |
['@semantic-release/commit-analyzer']
- name: Go List
if: steps.semantic.outputs.new-release-published == 'true'
run: GOPROXY=proxy.golang.org go list -m github.com/pokt-foundation/transaction-db@v${{ steps.semantic.outputs.release-version }}
docker:
if: needs.release.outputs.version
name: Docker Build & Push
needs: [release]
timeout-minutes: 15
runs-on: ubuntu-22.04
environment: CI
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker images
uses: docker/build-push-action@v3
with:
push: true
context: .
file: ./Dockerfile
tags: |
pocketfoundation/test-transaction-postgres:latest
pocketfoundation/test-transaction-postgres:${{ needs.release.outputs.version }}