-
Notifications
You must be signed in to change notification settings - Fork 3
51 lines (42 loc) · 1.36 KB
/
publish.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
name: Build and Publish Site
on:
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
env:
MY_ENV_VAR: "some_value"
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'
- name: Install dependencies
run: npm install
- name: Build project
env:
AIRTABLE_TOKEN: ${{ secrets.AIRTABLE_TOKEN }}
AIRTABLE_PEOPLE_BASE_ID: appk2btw36qEO3vFo
AIRTABLE_RESEARCH_BASE_ID: appTv9J1zxqaNgBHi
AIRTABLE_EVENTS_BASE_ID: tbl6CURONRn8ML6le
AIRTABLE_POSTS_BASE_ID: appsY0VXF7pbv3mKR
AIRTABLE_MITH_BASE_ID: appMWsw8HKjjokBg2
run: npm run build
- name: Deploy to server
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SSH_USER: ${{ secrets.SSH_USER }}
SSH_HOST: ${{ secrets.SSH_HOST }}
SSH_REMOTE_PATH: ${{ secrets.SSH_REMOTE_PATH }}
run: |
mkdir -p ~/.ssh
ssh-keyscan $SSH_HOST >> ~/.ssh/known_hosts
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
rsync -avz --delete --quiet ./public/ $SSH_USER@$SSH_HOST:$SSH_REMOTE_PATH
- name: Clean up
run: |
rm -rf ./public/
rm ~/.ssh/id_rsa