-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (34 loc) · 1.03 KB
/
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
name: dear Web
on:
push:
branches: "main"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install dependencies
run: yarn install
- name: Create config directory and config.json
run: |
mkdir -p ./src/config
echo '${{ secrets.CONFIG }}' > ./src/config/config.json
- name: Build Next.js application
run: yarn run build
- name: Deploy with SSH
if: github.ref == 'refs/heads/main'
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }} # EC2 인스턴스 퍼블릭 DNS 또는 퍼블릭 IP
username: ec2-user
key: ${{ secrets.PRIVATE_KEY }} # pem 키
port: ${{ secrets.PORT }}
env:
S3_BUCKET_NAME: dear-web
CODE_DEPLOY_APPLICATION_NAME: dear-web
CODE_DEPLOY_DEPLOYMENT_GROUP_NAME: dear-web-group