Skip to content

Client Deployment

Client Deployment #20

Workflow file for this run

name: Client Deployment
on:
push:
branches:
- main
paths:
- "apps/client/**"
workflow_dispatch:
inputs:
environment:
description: "배포 환경 (dev/prod)"
required: true
default: "dev"
type: choice
options:
- dev
- prod
jobs:
deploy:
name: Deploy Client
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "20"
- name: Setup PNPM
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Prebuild packages
run: pnpm run prebuild
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v3
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Deploy to environment (auto)
if: github.event_name == 'push'
working-directory: ./apps/client/
run: bash .script/deploy.sh dev
- name: Deploy to selected environment (manual)
if: github.event_name == 'workflow_dispatch'
working-directory: ./apps/client/
run: bash .script/deploy.sh ${{ github.event.inputs.environment }}