delete apscheduler #27
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
name: quant-tool-build | |
on: | |
push: | |
branches: [ "main" ] | |
workflow_dispatch: | |
jobs: | |
build: | |
# 后续可以改成自己的服务器 | |
runs-on: ubuntu-latest | |
steps: | |
# 拉取对应代码 | |
- uses: actions/checkout@v3 | |
- name: docker build | |
run: | | |
docker build . --file Dockerfile -t quant-toolbox:v0.$GITHUB_RUN_NUMBER --platform=linux/amd64 | |
docker save -o quant-toolbox.tar.gz quant-toolbox:v0.$GITHUB_RUN_NUMBER | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: quant-toolbox.tar.gz | |
path: ./quant-toolbox.tar.gz | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: deploy.sh | |
path: ./deploy.sh | |
deploy: | |
needs: [build] | |
env: | |
DEPLOY_HOST: ${{ secrets.TENCENT_HOST }} | |
DEPLOY_KEY: ${{ secrets.TENCENT_PRI_KEY }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: quant-toolbox.tar.gz | |
- uses: actions/download-artifact@v3 | |
with: | |
name: deploy.sh | |
- name: RSyncer Action | |
uses: Pendect/[email protected] | |
with: | |
flags: '-avzrP --delete' | |
options: '' | |
ssh_options: '' | |
src: './' | |
dest: 'work@${DEPLOY_HOST}:/home/work/artifact/quant-toolbox' | |
- name: Display status from deploy | |
run: echo "${{ steps.deploy.outputs.status }}" | |
- name: deploy quant-toolbox | |
run: | | |
mkdir -p ~/.ssh/ && echo "${DEPLOY_KEY}" > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa | |
ssh -o StrictHostKeyChecking=no work@${DEPLOY_HOST} "cd /home/work/artifact/quant-toolbox && sh deploy.sh" | |