Skip to content

Merge pull request #43 from ije90s/dev #28

Merge pull request #43 from ije90s/dev

Merge pull request #43 from ije90s/dev #28

Workflow file for this run

name: CI/CD Test With CodeDeploy
on:
push:
branches: [ main ]
jobs:
deploy:
if: false
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install Package
run: npm ci
- name: Test
run: npm test
- name: Build
run: npm run build
- name: Zip
run: tar -czf $GITHUB_SHA.tar.gz appspec.yml scripts dist package.json package-lock.json ecosystem.config.js
- name: AWS credentials 설정
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ap-northeast-2
aws-access-key-id: ${{ secrets.AWS_SECRET_ACCESS_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: S3 Upload
run: aws s3 cp --region ap-northeast-2 ./$GITHUB_SHA.tar.gz s3://challenge-api-ci-cd/$GITHUB_SHA.tar.gz
- name: Code Deploy
run: |
aws deploy create-deployment \
--application-name challenge-api \
--deployment-config-name CodeDeployDefault.AllAtOnce \
--deployment-group-name Production \
--s3-location bucket=challenge-api-ci-cd,bundleType=tgz,key=$GITHUB_SHA.tar.gz