-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (47 loc) · 1.4 KB
/
ci.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
name: Deploy and Audit
on:
push:
branches:
- master
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Set up Tailscale
uses: tailscale/github-action@v2
with:
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
tags: tag:servers
- name: Execute deployment script
run: |
echo "Connecting to remote server..."
ssh -o StrictHostKeyChecking=no ubuntu@codenexis << 'EOF'
echo "Starting deployment..."
cd website
echo "Running deploy.sh..."
sudo su -c 'bash deploy.sh 2>&1 | tee -a /tmp/deployment_script.log'
echo "Deployment completed."
exit 0
EOF
audit:
runs-on: ubuntu-latest
needs: deploy
if: ${{ success() }}
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Set up Node.js
uses: actions/[email protected]
with:
node-version: '22'
- name: Install dependencies
run: npm install discord.js node-fetch
- name: Run audit
env:
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
LIGHTHOUSE_API_KEY: ${{ secrets.LIGHTHOUSE_API_KEY }}
run: node ./utils/audit.js