-
Notifications
You must be signed in to change notification settings - Fork 2
114 lines (93 loc) · 3.12 KB
/
release-development.yaml
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Release Develop
on:
push:
branches:
- develop
paths:
- 'src/**/*'
- default.project.json
- mantle.yaml
- package.json
workflow_dispatch:
permissions:
contents: write
packages: write
concurrency:
group: development_environment
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Install pnpm
uses: pnpm/action-setup@v3
- name: Use Node.js 20
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
node-version: 20
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Install roblox-ts
run: pnpm add roblox-ts
- name: Setup Rokit
uses: CompeyDev/setup-rokit@d49be92bd9502180218c3f43e7988faa945217b0 # v0.1.2
- name: Compile
run: npx rbxtsc --verbose
- name: Build project
run: rojo build ./default.project.json --output place.rbxlx
- name: Upload place
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
with:
name: place
path: place.rbxlx
if-no-files-found: error
deploy:
runs-on: ubuntu-latest
environment: development
needs: build
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Setup Rokit
uses: CompeyDev/setup-rokit@d49be92bd9502180218c3f43e7988faa945217b0 # v0.1.2
- name: Download place artifact
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4
with:
name: place
# As ROBLOSECURITY keys are region locked, we need to use a VPN to ensure
# the github actions runner is in the same region as our Roblox account.
- name: WireGuard Connection
run: |
sudo apt install resolvconf wireguard
echo "${{ secrets.WG_CONFIG_FILE }}" > wg0.conf
sudo chmod 600 wg0.conf
echo "setting config"
sudo wg-quick up ./wg0.conf
shell: bash
# Ensure the IP has changed before deploying
- name: Poll for IP Change
run: |
elapsed=0
while true; do
response=$(curl -s 'https://httpbin.org/ip')
content=$(echo $response | jq -r '.origin')
if [ "$content" == "104.199.120.221" ]; then
break
fi
if [ $elapsed -ge 20 ]; then
echo "Timeout reached!"
exit 1
fi
echo "Polling.. Elapsed: $elapsed, IP: $content"
sleep 5
elapsed=$((elapsed + 5))
done
echo "Success!"
- name: Deploy place
run: mantle deploy mantle.yaml --environment development
env:
ROBLOSECURITY: ${{ secrets.ROBLOSECURITY }}
MANTLE_OPEN_CLOUD_API_KEY: ${{ secrets.MANTLE_OPEN_CLOUD_API_KEY }}
MANTLE_AWS_ACCESS_KEY_ID: ${{ secrets.MANTLE_AWS_ACCESS_KEY_ID }}
MANTLE_AWS_SECRET_ACCESS_KEY: ${{ secrets.MANTLE_AWS_SECRET_ACCESS_KEY }}