-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (47 loc) · 1.39 KB
/
deployment.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
57
58
name: Deploy SeolMyeongTang Client
on:
push:
branches: [main]
jobs:
deployment:
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-northeast-2
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "16"
- name: Create Env File
run: |
touch .env
echo '${{ secrets.ENV }}' >> .env
- name: Install Dependencies
run: yarn
- name: Build
run: yarn build
- name: Compress
run: tar -zcf ${GITHUB_SHA::8}.tar.gz out
- name: Upload to S3
run: |
aws s3 mv --region ap-northeast-2 \
${GITHUB_SHA::8}.tar.gz \
${{ secrets.S3_CLIENT_LOCATION }}/${GITHUB_SHA::8}.tar.gz
- name: Deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
port: ${{ secrets.PORT }}
key: ${{ secrets.KEY }}
envs: GITHUB_SHA
script: |
cd ~/SeolMyeongTang
./deploy.sh ${GITHUB_SHA::8}