Add workflows/build-service.yml
This commit is contained in:
parent
e69f62b9cb
commit
659f4c9982
1 changed files with 49 additions and 0 deletions
49
workflows/build-service.yml
Normal file
49
workflows/build-service.yml
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
- master
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: host
|
||||
steps:
|
||||
- name: Checkout app
|
||||
shell: bash -l {0}
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
path: app
|
||||
- name: Test
|
||||
run: go test -v ./...
|
||||
working-directory: app
|
||||
- name: Checkout scripts
|
||||
shell: bash -l {0}
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: develop/scripts
|
||||
ref: master
|
||||
path: scripts
|
||||
token: ${{ secrets.DEPLOY_KEY }}
|
||||
- run: chmod +rwx scripts/build/build.sh
|
||||
- name: Build app
|
||||
run: scripts/build/build.sh
|
||||
env:
|
||||
BRANCH: dev
|
||||
BUILD_DIR: app
|
||||
BUILD_TAGS: grpc
|
||||
GITHOST: ${{ vars.GITHOST }}
|
||||
GITHOST_LOGIN: ${{ vars.GITHOST_LOGIN }}
|
||||
GITHOST_PASSWORD: ${{ secrets.GITHOST_PASSWORD }}
|
||||
- name: Login to Docker Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ vars.REGISTRY }}
|
||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||
- run: chmod +rwx scripts/build/build-docker.sh
|
||||
- name: Build & Push docker
|
||||
run: scripts/build/build-docker.sh
|
||||
env:
|
||||
REGISTRY: ${{ vars.REGISTRY }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue