diff --git a/.gitea/workflows/CD_pub_deploy.yaml b/.gitea/workflows/CD_pub_deploy.yaml new file mode 100644 index 0000000..0003da0 --- /dev/null +++ b/.gitea/workflows/CD_pub_deploy.yaml @@ -0,0 +1,26 @@ +name: 公网服务发布 +run-name: ${{ gitea.actor }} is testing out Gitea Actions +on: + release: + types: [published] + +jobs: + Download-And-Deploy-Release: + runs-on: joylink-local233 + steps: + - name: 发布到正式环境1 + uses: https://gitea.joylink.club/appleboy/ssh-action@v1.0.3 + with: + host: ${{ secrets.PUB1_DOMAIN_SSH_HOST }} + port: ${{ secrets.PUB1_DOMAIN_SSH_PORT }} + username: ${{ secrets.PUB1_DOMAIN_SSH_USER }} + password: ${{ secrets.PUB1_DOMAIN_SSH_PASSWORD }} + script: | + release=${{ github.event.release.tag_name }} + asset_url=${{ github.event.release.assets[0].browser_download_url }} + echo "Release is: $release, asset_download_url is: $asset_url" + mkdir -p ./downloads + wget -O ./downloads/target.tar $asset_url + mkdir -p /usr/local/joylink/client/gdtraining + rm -rf /usr/local/joylink/client/gdtraining/* + tar xv --strip 1 -f ./downloads/target.tar -C /usr/local/joylink/client/gdtraining/