Skip to content

fix :: deploy.yml

fix :: deploy.yml #49

Workflow file for this run

name: Deploy dear-web
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '20'
- name: Install dependencies
run: yarn install
- name: Create config directory and config.json
run: |
mkdir -p ./src/config
echo "{\"server\": \"${{ secrets.CONFIG }}\"}" > ./src/config/config.json
- name: Build Next.js project
run: yarn run build
- name: Deploy to EC2
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
username: ec2-user
key: ${{ secrets.PRIVATE_KEY }}
port: ${{ secrets.PORT }}
source: ".next/*"
target: "/var/www/dear"