this repo has no description
1name: Deploy
2
3on:
4 push:
5 branches:
6 - main
7 - astra/ci
8
9
10jobs:
11 deploy:
12 name: Deploy
13 runs-on: ubuntu-latest
14
15 steps:
16 - name: Checkout main repo
17 uses: actions/checkout@v4
18
19 - name: Checkout overrides repo
20 uses: actions/checkout@v4
21 with:
22 repository: scientific-witchery/pds-dash-overrides
23 token: ${{ secrets.OVERRIDES_TOKEN}}
24 path: overrides
25
26 - name: Copy config file to root
27 run: cp overrides/config.ts ./config.ts
28
29 - name: Setup Node.js
30 uses: actions/setup-node@v3
31 with:
32 node-version: '20'
33
34 - name: Setup Deno
35 uses: https://github.com/denoland/setup-deno@v2
36
37 - name: Install dependencies
38 run: deno install
39
40 - name: Build project
41 run: deno task build
42
43 - name: Setup SSH
44 run: |
45 mkdir -p ~/.ssh
46 echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
47 chmod 600 ~/.ssh/id_ed25519
48 cat > ~/.ssh/config << EOF
49 Host deploy
50 HostName ${{ vars.SERVER_HOST }}
51 User ${{ vars.SERVER_USER }}
52 IdentityFile ~/.ssh/id_ed25519
53 StrictHostKeyChecking accept-new
54 BatchMode yes
55 PasswordAuthentication no
56 PubkeyAuthentication yes
57 EOF
58 chmod 600 ~/.ssh/config
59 ssh-keyscan -H ${{ vars.SERVER_HOST }} >> ~/.ssh/known_hosts
60 echo "Deploying to ${{ vars.SERVER_HOST }} as ${{ vars.SERVER_USER }} to /var/www/pds/${{ github.ref_name }}"
61
62 - name: Debug SSH Connection
63 run: ssh -v deploy echo "SSH Connection Successful"
64
65 - name: Create folder if not exists
66 run: ssh deploy "mkdir -p /var/www/pds/${{ github.ref_name }}"
67
68 - name: Deploy via SCP
69 run: scp -r ./dist/* deploy:/var/www/pds/${{ github.ref_name }}