From db1f8e64e7631d739187b2f1c635a1f051da7a90 Mon Sep 17 00:00:00 2001 From: soul-walker Date: Wed, 29 May 2024 17:13:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=BA=BF=E4=B8=8A=E6=8C=81?= =?UTF-8?q?=E7=BB=AD=E5=8F=91=E5=B8=83gitea=20action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/CD_pub_deploy.yaml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .gitea/workflows/CD_pub_deploy.yaml 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/