Skip to content

infra: 배포 스크립트 수정 #48

infra: 배포 스크립트 수정

infra: 배포 스크립트 수정 #48

name: deploy
on:
workflow_dispatch:
push:
branches:
- prod/frontend
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Add Enviromnet
run: |
cd frontend
touch .env
echo "${{ secrets.GOOGLE_MAPS_API_KEY }}" >> .env
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 18.16.0
- name: Install dependencies
run: npm install
- name: Cache node_modules
id: cache
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Build
run: npm run build
- name: Upload build files
uses: actions/upload-artifact@v3
with:
name: Prod
path: frontend/dist
deploy:
needs: build
runs-on: self-hosted
steps:
- name: Download the built file to AWS
uses: actions/download-artifact@v3
with:
name: Prod
path: frontend/prod/dist