-
Notifications
You must be signed in to change notification settings - Fork 105
77 lines (75 loc) · 2.32 KB
/
deploy-master.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Deploy wandbox.org
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Register SSH key
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
run: |
mkdir -p $HOME/.ssh
echo "$SSH_PRIVATE_KEY" > $HOME/.ssh/id_ed25519
chmod 600 $HOME/.ssh/id_ed25519
- name: Add SSH config
env:
SSH_HOST: ${{ secrets.SSH_HOST_UBUNTU_24_04 }}
SSH_USER: ${{ secrets.SSH_USER }}
run: |
set -ex
echo "Host wandbox-ubuntu-24.04" >> $HOME/.ssh/config
echo " HostName $SSH_HOST" >> $HOME/.ssh/config
echo " User $SSH_USER" >> $HOME/.ssh/config
echo " ServerAliveInterval 60" >> $HOME/.ssh/config
echo " TCPKeepAlive yes" >> $HOME/.ssh/config
ssh-keyscan -H $SSH_HOST >> $HOME/.ssh/known_hosts
- name: apt install
run: sudo apt-get install -y libcap-dev
- name: Get cached tools
id: cache-tools
uses: actions/cache@v4
with:
path: _install
key: install-deps-v3
- name: Package cattleshed
run: python3 run.py package --env master cattleshed
- name: Package kennel
run: python3 run.py package --env master kennel
- name: Deploy cattleshed to wandbox.org
run: |
python3 run.py deploy wandbox-ubuntu-24.04 cattleshed --env master
- name: Deploy kennel to wandbox.org
run: |
python3 run.py deploy wandbox-ubuntu-24.04 kennel --env master
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Cache node modules
uses: actions/cache@v4
env:
cache-name: cache-node-modules-v2
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('canine/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Build Workers
working-directory: canine
run: |
set -ex
npm install
npm run build
# - name: Publish canine
# working-directory: canine
# env:
# CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
# run: |
# set -ex
# npm install -g @cloudflare/wrangler
# npm run deploy:prod