🔨 Fix: ì ˆëŒ€ê²½ë¡œë¡œ 변경 #142
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy main | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
cache: npm | |
- name: Prepare deploy script with environment variable | |
run: | | |
mkdir -p scripts | |
echo "doppler run --token ${DOPPLER_TOKEN} -p remak -c prd -- pm2 reload /home/ec2-user/deploy/ecosystem.json" > scripts/deploy.sh | |
env: | |
DOPPLER_TOKEN: ${{ secrets.DOPPLER_TOKEN }} | |
shell: bash | |
- name: Install dependencies | |
run: npm install | |
- name: Build | |
run: npm run build | |
- name: Generate deployment package | |
run: zip -r deploy.zip . -x '*.git*' | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
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: Upload to S3 | |
run: aws s3 cp deploy.zip s3://remak-deploy/deploy.zip | |
- name: Deploy with AWS CodeDeploy | |
run: | | |
aws deploy create-deployment \ | |
--application-name remak \ | |
--deployment-group-name remak-prod \ | |
--s3-location bucket=remak-deploy,key=deploy.zip,bundleType=zip |