-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (50 loc) · 1.52 KB
/
deploy-toolforge.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
name: Deploy to Toolforge
on:
push:
tags:
- v0.*
schedule:
- cron: '30 12 * * MON'
jobs:
deploy-toolforge:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 8
- name: Install & Build
run: |
pnpm install --frozen-lockfile
pnpm run build
- name: Copy build file to production env
uses: appleboy/scp-action@v0.1.7
with:
host: login.toolforge.org
username: ${{ secrets.TOOLFORGE_USERNAME }}
key: ${{ secrets.TOOLFORGE_KEY }}
source: './dist'
target: '~/.'
- name: Deploy
uses: appleboy/ssh-action@v1.0.3
with:
host: login.toolforge.org
username: ${{ secrets.TOOLFORGE_USERNAME }}
key: ${{ secrets.TOOLFORGE_KEY }}
script: |
xargs rm -r < /data/project/wscd/purge_list.txt &&
rm /data/project/wscd/purge_list.txt &&
pushd dist &&
printf '/data/project/wscd/public_html/%s\n' * > /data/project/wscd/purge_list.txt &&
popd &&
cp -r ~/dist/. /data/project/wscd/public_html &&
rm -rf ~/dist &&
become wscd bash -c "take purge_list.txt public_html && chmod -R g+w purge_list.txt public_html"