generated from caicloud/golang-template-project
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
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 1.14 | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.14.7 | ||
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 "::set-env name=GOPATH::$(go env GOPATH):$GITHUB_WORKSPACE" | ||
echo "::add-path::$(go env GOPATH)/bin" | ||
- name: before_install | ||
run: | | ||
# get coveralls.io support | ||
go get github.com/kleveross/goveralls | ||
- 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:${{ github.ref }} -f build/ormb/Dockerfile . | ||
docker build -t ghcr.io/kleveross/klever-ormb-storage-initializer:${{ github.ref }} -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:${{ github.ref }} | ||
docker push ghcr.io/kleveross/klever-ormb-storage-initializer:${{ github.ref }} | ||