Skip to content

Commit

Permalink
update ci (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
yaojin3616 committed Sep 18, 2023
2 parents 0291a82 + d4ff19d commit b3f5303
Showing 1 changed file with 23 additions and 15 deletions.
38 changes: 23 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ on:

env:
DOCKERHUB_REPO: dataelement/
PY_NEXUS: http://110.16.193.170:50083
DOCKER_NEXUS: http://110.16.193.170:50080
PY_NEXUS: 110.16.193.170:50083
DOCKER_NEXUS: 110.16.193.170:50080

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -43,30 +43,38 @@ jobs:
pip install twine
cd ./src/bisheng-langchain
python setup.py bdist_wheel
repo="${{ env.PY_NEXUS }}/repository/pypi-hosted/"
repo="http://${{ env.PY_NEXUS }}/repository/pypi-hosted/"
twine upload --verbose -u ${{ secrets.NEXUS_USER }} -p ${{ secrets.NEXUS_PASSWORD }} --repository-url $repo dist/*.whl
# 发布到 私有仓库
- name: set insecure registry
run: |
echo "{ \"insecure-registries\": [\"${{ env.DOCKER_NEXUS }}\"] }" | sudo tee /etc/docker/daemon.json
echo "{ \"insecure-registries\": [\"http://${{ env.DOCKER_NEXUS }}\"] }" | sudo tee /etc/docker/daemon.json
sudo service docker restart
- name: Set up QEMU
uses: docker/setup-qemu-action@v1

# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v1
# with:
# config-inline: |
# [registry."http://110.16.193.170:50083"]
# http = true
# insecure = true

- name: Login Nexus Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.DOCKER_NEXUS }}
registry: http://${{ env.DOCKER_NEXUS }}/
username: ${{ secrets.NEXUS_USER }}
password: ${{ secrets.NEXUS_PASSWORD }}

# 替换poetry编译为私有服务
- name: replace self-host repo
uses: snok/install-poetry@v1
with:
installer-parallel: true

- name: build lock
run: |
cd ./src/backend
poetry source add --priority=default foo http://${{ secrets.NEXUS_PUBLIC }}:${{ secrets.NEXUS_PUBLIC_PASSWORD }}@${{ env.PY_NEXUS }}/repository/pypi-group/simple
poetry lock
cd ../../
# 构建 backend 并推送到 Docker hub
- name: Build backend and push
id: docker_build_backend
Expand All @@ -82,7 +90,7 @@ jobs:
APP_VERSION="release"
# 生成两个 docker tag: ${APP_VERSION} 和 latest
tags: |
${{ env.DOCKERHUB_REPO }}bisheng-backend:release
${{ env.DOCKER_NEXUS }}/${{ env.DOCKERHUB_REPO }}bisheng-backend:release
# 构建 Docker frontend 并推送到 Docker hub
- name: Build frontend and push
id: docker_build_frontend
Expand All @@ -98,6 +106,6 @@ jobs:
APP_VERSION="release"
# 生成两个 docker tag: ${APP_VERSION} 和 latest
tags: |
${{ env.DOCKERHUB_REPO }}bisheng-frontend:release
${{ env.DOCKER_NEXUS }}/${{ env.DOCKERHUB_REPO }}bisheng-frontend:release

0 comments on commit b3f5303

Please sign in to comment.