-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (39 loc) · 1.13 KB
/
cd.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
name: Continuous Deployment
on:
push:
branches:
- main
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: latest
- uses: actions/checkout@v4
- name: Install NPM Dependencies
run: pnpm i
- name: Build
run: npm run build
- uses: actions/upload-artifact@v4
with:
name: build
path: build/
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: ${{ github.event_name == 'release' && 'production' || 'development' }}
steps:
- name: Setup SSH Agent
uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{secrets.DEPLOY_PRIVATE_KEY}}
- uses: actions/download-artifact@v4
with:
name: build
- name: Transfer artifact to target
run: scp -o "StrictHostKeyChecking no" -r ./* ${{secrets.DEPLOY_SSH_URL}}