-
Notifications
You must be signed in to change notification settings - Fork 2
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
2 changed files
with
54 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,6 @@ | ||
**What this PR does / why we need it**: | ||
|
||
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: | ||
Fixes # | ||
|
||
**Special notes for your reviewer**: |
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,48 @@ | ||
name: Hipush Docker Image | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'releases/**' | ||
- 'main' | ||
- 'master' | ||
paths: | ||
- 'api/**.go' | ||
- 'cmd/**.go' | ||
- 'config/**.go' | ||
- 'internal/**.go' | ||
jobs: | ||
build_hipush: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 8 | ||
|
||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.20' | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: https://${{ secrets.REGISTRY }} | ||
username: ${{ secrets.REGISTRY_USERNAME }} | ||
password: ${{ secrets.REGISTRY_PASSWORD }} | ||
|
||
- name: Build And Push Docker Image | ||
shell: bash | ||
run: | | ||
set -o xtrace | ||
branch="${GITHUB_REF#refs/heads/}" | ||
timestamp=`TZ="Asia/Shanghai" date +"%Y%m%d%H%M%S"` | ||
export GO111MODULE=on | ||
export VERSION="$branch-$timestamp-solo" | ||
export GOOS=linux | ||
export ARCH=all | ||
export REGISTRY=${{ secrets.REGISTRY }}/cossim | ||
make docker-build docker-push |