-
Notifications
You must be signed in to change notification settings - Fork 1
34 lines (28 loc) · 988 Bytes
/
Copy pathdeploy.yml
File metadata and controls
34 lines (28 loc) · 988 Bytes
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
name: Deploy website
on:
push:
branches:
- prod
pull_request:
branches:
- prod
jobs:
deploy:
runs-on: ubuntu-latest
container:
image: node:20
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
- run: npm ci
- run: npm run build
- name: Get SSH key and run commands
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_ENTRY_KEY }}" > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa
echo "${{ secrets.PUBLIC_SSH_KEY }}" >> ~/.ssh/id_rsa.pub && chmod 600 ~/.ssh/id_rsa.pub
- run: echo "currently here"
- name: Deploy to server
run: scp -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa -r ./dist/* ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }}:${{ secrets.DEPLOY_PATH }}