generated from caicloud/golang-template-project
-
Notifications
You must be signed in to change notification settings - Fork 61
48 lines (46 loc) · 1.65 KB
/
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
45
46
47
48
name: Publish
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
ormb-publish:
runs-on:
#- self-hosted
- ubuntu-latest
timeout-minutes: 60
steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.17
id: go
- uses: actions/checkout@v2
with:
path: src/github.com/kleveross/ormb
- name: setup env
run: |
cd src/github.com/kleveross/ormb
pwd
go env
echo "GOPATH=$(go env GOPATH):$GITHUB_WORKSPACE" >> $GITHUB_ENV
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: install
run: |
cd src/github.com/kleveross/ormb
go env GOROOT
make build
- name: docker-build
run: |
cd src/github.com/kleveross/ormb
docker build -t ghcr.io/kleveross/klever-ormb:$RELEASE_VERSION -f build/ormb/Dockerfile .
docker build -t ghcr.io/kleveross/klever-ormb-storage-initializer:$RELEASE_VERSION -f build/ormb-storage-initializer/Dockerfile .
- name: Login to GitHub Container Registry
run: echo "${{ secrets.GHCR_TOKEN }}" | docker login ghcr.io -u ${{ secrets.GHCR_USERNAME }} --password-stdin
- name: docker-push
run: |
docker push ghcr.io/kleveross/klever-ormb:$RELEASE_VERSION
docker push ghcr.io/kleveross/klever-ormb-storage-initializer:$RELEASE_VERSION