-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (46 loc) · 1.37 KB
/
front_deploy.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
name: deploy frontend server
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout repository and set up
uses: actions/checkout@v4
- name: setup pnpm
uses: pnpm/action-setup@v3
with:
version: 8
- name: generate env file
run: |
touch .env
echo VITE_API_URL="${{ secrets.VITE_API_URL }}" >> .env
echo VITE_AWS_LAMBDA_URL="${{ secrets.VITE_AWS_LAMBDA_URL }}" >> .env
echo VITE_AWS_CLOUDFRONT_URL="${{ secrets.VITE_AWS_CLOUDFRONT_URL }}" >> .env
cat .env
- name: build before install pnpm
run: pnpm install
- name: build process
run: pnpm run build
- name: compress build files
run: tar -cvf build.tar dist
- name: copy file via ssh key (scp)
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.PRIVATE_KEY }}
source: 'build.tar'
target: /home/ubuntu/
- name: run deploy script via scp
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.PRIVATE_KEY }}
script: |
pwd
ls -al
bash front-deploy.sh