-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (38 loc) · 1.02 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
name: Publish
on:
push:
branches:
- "main"
jobs:
build:
name: Build
runs-on: ubuntu-22.04
env:
DEPLOY_DESTINATION: ${{ secrets.DEPLOY_DESTINATION }}
DEPLOY_PORT: ${{ secrets.DEPLOY_PORT }}
SSHKEY: ${{ secrets.SSHKEY }}
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
strategy:
matrix:
node-version: [23.x]
permissions:
contents: read
security-events: write
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install dependendencies
run: npm install
- name: Test
run: npm run test
- name: Build
run: npm run build
- name: Deploy
run: |
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add - <<< "${{ env.SSHKEY }}" > /dev/null
scp -P ${{ env.DEPLOY_PORT }} -o StrictHostKeyChecking=no -r dist/* ${{ env.DEPLOY_DESTINATION }} > /dev/null