Skip to content

Commit

Permalink
CodeDeploy Test - Regular build, pnpm
Browse files Browse the repository at this point in the history
CodeDeploy Test - Regular build, pnpm
  • Loading branch information
jwo0o0 authored Nov 20, 2024
2 parents 822b13e + 202c46e commit 1b281ac
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
S3_BUCKET_NAME: sns-client-bucket
CODE_DEPLOY_APPLICATION_NAME: sns-client-code-deploy
CODE_DEPLOY_GROUP_NAME: ec2-deploy

jobs:
deploy:
name: Deploy to EC2
Expand All @@ -24,7 +24,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 20

- name: Cache pnpm
uses: actions/cache@v3
with:
Expand All @@ -46,13 +46,13 @@ jobs:
echo "NEXT_PUBLIC_PROD_API_URL=${{ secrets.NEXT_PUBLIC_PROD_API_URL }}" > .env
- name: Build Next.js app
run: pnpm build build
run: pnpm build

- name: Make zip file
run: |
zip -qq -r nextjs-app-${{ github.sha }}.zip . -x ".git/*"
shell: bash

- name: Clean old files from S3
run: |
aws s3 ls s3://${{ env.S3_BUCKET_NAME }}/ | awk '{print $4}' | grep 'nextjs-app-' | while read file; do
Expand All @@ -62,7 +62,7 @@ jobs:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ env.AWS_REGION }}

- name: Upload to S3
run: |
aws s3 cp nextjs-app-${{ github.sha }}.zip s3://${{ env.S3_BUCKET_NAME }}/nextjs-app-${{ github.sha }}.zip
Expand All @@ -77,7 +77,7 @@ jobs:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}

- name: Deploy via AWS CLI
run: |
aws deploy create-deployment \
Expand Down

0 comments on commit 1b281ac

Please sign in to comment.