Skip to content

Merge pull request #101 from TeamHARA/feat/endAlarm #15

Merge pull request #101 from TeamHARA/feat/endAlarm

Merge pull request #101 from TeamHARA/feat/endAlarm #15

Workflow file for this run

name: CD
on:
push:
branches: [main]
jobs:
build-and-deploy:
runs-on: ubuntu-20.04
environment: development
strategy:
matrix:
node-version: [18.11.0]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- name: Checkout source code.
uses: actions/checkout@v3
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Create env file
working-directory: ./
run: |
pwd
touch .env
echo DATABASE_URL=${{ secrets.DATABASE_URL }} >> .env
echo JWT_SECRET=${{ secrets.JWT_SECRET }} >> .env
echo JWT_ALGO=${{ secrets.JWT_ALGO }} >> .env
echo KAKAO_CLIENT_ID=${{ secrets.KAKAO_CLIENT_ID }} >> .env
echo KAKAO_REDIRECT_URI=${{ secrets.KAKAO_REDIRECT_URI }} >> .env
echo KAKAO_SECRET_KEY=${{ secrets.KAKAO_SECRET_KEY }} >> .env
echo APPLE_CLIENT_ID=${{ secrets.APPLE_CLIENT_ID }} >> .env
cat .env
- name: Create firebase-amin json
id: create-json
uses: jsdaniell/[email protected]
with:
name: "firebase-admin.json"
json: ${{ secrets.FIREBASE_JSON }}
- name: Install dependencies
working-directory: ./
run: yarn
- name: Yarn run build
working-directory: ./
run: yarn run build
- name: Zip file
run: zip -r kaera.zip ./dist ./scripts ./appspec.yml ./.env ./package.json ./prisma ./swagger.yaml ./firebase-admin.json
- name: AWS configure credentials
uses: aws-actions/configure-aws-credentials@v1-node16
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 --region ap-northeast-2 ./kaera.zip s3://kaera-develop-bucket/deploy/
- name: Deploy with AWS codeDeploy
run: aws deploy create-deployment
--application-name kaera-codedeploy
--deployment-config-name CodeDeployDefault.OneAtATime
--deployment-group-name dev
--s3-location bucket=kaera-develop-bucket,bundleType=zip,key=deploy/kaera.zip