Skip to content

Commit

Permalink
feat(action): 添加github工作流
Browse files Browse the repository at this point in the history
  • Loading branch information
am6737 committed Mar 1, 2024
1 parent bc85924 commit ac33ec2
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/pull_request_template.md
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**:
48 changes: 48 additions & 0 deletions .github/workflows/docker_hipush.yml
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

0 comments on commit ac33ec2

Please sign in to comment.