-
Notifications
You must be signed in to change notification settings - Fork 22
63 lines (56 loc) · 1.63 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Deploy Testnet
permissions:
contents: write
pull-requests: read
env:
VERSION: ${{ github.event.inputs.tag }}
on:
workflow_dispatch:
inputs:
tag:
type: string
description: What is the release tag? (e.g. "1.0.2")
required: true
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Check release version
id: release-version
env:
VERSION: ${{ env.VERSION }}
run: |
if [[ ! "${VERSION}" =~ ^[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then
echo "Invalid version tag '${VERSION}'"
exit 1
fi
- name: Checkout code
uses: actions/checkout@v4
- name: SSH into Compute Engine
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.VPS_HOST }}
username: ${{ secrets.VPS_USERNAME }}
key: ${{ secrets.VPS_PRIVATE_KEY }}
port: 22
script: |
cd ${{ secrets.PROJECT_DIRECTORY }}
git switch main
git pull origin main
export NVM_DIR=~/.nvm
source ~/.nvm/nvm.sh
pnpm install
pnpm run prod
- name: Build Changelog
id: github_release
uses: mikepenz/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release
uses: softprops/action-gh-release@v2
with:
name: testnet@${{ env.VERSION }}
body: ${{steps.github_release.outputs.changelog}}
tag_name: ${{ format('{0}', env.VERSION) }}
prerelease: false
generate_release_notes: true