Skip to content

modeluploader without wait (#425) #2

modeluploader without wait (#425)

modeluploader without wait (#425) #2

Workflow file for this run

name: CPodManager-CI
on:
push:
branches: [ "main" ]
paths:
- 'cmd/**.go'
- 'deployment/**Dockerfile'
env:
DOCKERHUB_REPO: registry.cn-beijing.aliyuncs.com
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.21.1'
- name: Generate image tag
run: echo COMMIT_ID=`git rev-parse --short HEAD` >> $GITHUB_ENV
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
registry: ${{ env.DOCKERHUB_REPO }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Push images
run: |
go build -tags netgo -o cpodmanager ./cmd/cpodmanager/cpodmanager.go
go build -tags netgo -o modeluploadjob ./cmd/modeluploader/modeluploadjob.go
docker build --tag ${{ env.DOCKERHUB_REPO }}/sxwl-ai/cpodmanager:${{ env.COMMIT_ID }} --file ./deployment/cpodmanager/Dockerfile .
docker build --tag ${{ env.DOCKERHUB_REPO }}/sxwl-ai/modeluploader:${{ env.COMMIT_ID }} --file ./deployment/modeluploader/Dockerfile .
docker push ${{ env.DOCKERHUB_REPO }}/sxwl-ai/cpodmanager:${{ env.COMMIT_ID }}
docker push ${{ env.DOCKERHUB_REPO }}/sxwl-ai/modeluploader:${{ env.COMMIT_ID }}