-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
119 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: CD | ||
|
||
on: | ||
push: | ||
branches: [develop] | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-20.04 | ||
|
||
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.TEST_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 | ||
cat .env | ||
- 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 | ||
|
||
- 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-deploy-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-deploy-bucket,bundleType=zip,key=deploy/kaera.zip | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs | ||
|
||
name: CI | ||
|
||
on: | ||
pull_request: | ||
branches: [develop] | ||
|
||
jobs: | ||
build-and-test: | ||
runs-on: ubuntu-20.04 | ||
|
||
strategy: | ||
matrix: | ||
node-version: [18.x] | ||
# 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.TEST_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 | ||
cat .env | ||
- name: Install dependencies | ||
working-directory: ./ | ||
run: yarn | ||
|
||
- name: Yarn run build | ||
working-directory: ./ | ||
run: yarn run build | ||
|
||
- name: Test | ||
run: yarn test |
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