-
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.
* member GET API * add member status * implt member CRUD API * add tags * add AWS ECR image push step * comment github action condition * fix trigger condition * light weight github action * fix typo * add ecr login step * fix typo * last typo? * add info API * add gitattribute * implt github module * add octokit * eol lf * lf normalize files * update git attr * npm run lint * update README * use poapper db * member entity * member dto * re-design github action * add docker-stack * limit event counts * update stack config * add nginx config * mask ecr pw * update entity * update column properties * nullable...
- Loading branch information
1 parent
e7e0dae
commit cf9b93e
Showing
21 changed files
with
1,342 additions
and
48 deletions.
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
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,50 @@ | ||
# Encrypt the repository | ||
# Remove/modify this line if the repository is meant to be open-source | ||
*.* filter=git-crypt diff=git-crypt | ||
.gitattributes !filter !diff | ||
|
||
# These files are text and should be normalized (Convert crlf => lf) | ||
*.php text | ||
*.css text | ||
*.js text | ||
*.htm text | ||
*.html text | ||
*.xml text | ||
*.txt text | ||
*.ini text | ||
*.inc text | ||
.htaccess text | ||
|
||
# These files are binary and should be left untouched | ||
# (binary is a macro for -text -diff) | ||
*.png binary | ||
*.jpg binary | ||
*.jpeg binary | ||
*.gif binary | ||
*.ico binary | ||
*.mov binary | ||
*.mp4 binary | ||
*.mp3 binary | ||
*.flv binary | ||
*.fla binary | ||
*.swf binary | ||
*.gz binary | ||
*.zip binary | ||
*.7z binary | ||
*.ttf binary | ||
|
||
# Auto detect text files and perform LF normalization | ||
# http://davidlaing.com/2012/09/19/customise-your-gitattributes-to-become-a-git-ninja/ | ||
* text=auto | ||
|
||
# Documents | ||
*.doc diff=astextplain | ||
*.DOC diff=astextplain | ||
*.docx diff=astextplain | ||
*.DOCX diff=astextplain | ||
*.dot diff=astextplain | ||
*.DOT diff=astextplain | ||
*.pdf diff=astextplain | ||
*.PDF diff=astextplain | ||
*.rtf diff=astextplain | ||
*.RTF diff=astextplain |
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 |
---|---|---|
@@ -1,31 +1,60 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
release: | ||
types: [published] | ||
|
||
name: Github Action | ||
name: Docker Build and Push | ||
|
||
env: | ||
ECR_REGISTRY: 151345152001.dkr.ecr.ap-northeast-2.amazonaws.com | ||
ECR_REPOSITORY: poapper-api | ||
|
||
jobs: | ||
npm-build: | ||
name: npm build check | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Use Node.js 16 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
cache: 'npm' | ||
- run: npm ci | ||
- run: npm run build | ||
docker-build: | ||
name: Docker build check | ||
runs-on: ubuntu-20.04 | ||
docker_build_and_push: | ||
name: Docker build and push | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- run: docker build . -t nestjs-boilerplate | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
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: Login to Amazon ECR | ||
uses: aws-actions/amazon-ecr-login@v1 | ||
with: | ||
mask-password: 'true' | ||
- name: Determine Prod/Dev Stage | ||
run: | | ||
if [[ ${{ github.event_name }} == 'release' ]]; then | ||
echo "PROD" | ||
echo "IMAGE_TAG=${{ github.event.release.tag_name }}" >> $GITHUB_ENV | ||
else | ||
echo "DEV" | ||
echo "IMAGE_TAG=latest" >> $GITHUB_ENV | ||
fi | ||
- name: Build and Push | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
tags: ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
push: true | ||
|
||
deploy_health_check: | ||
name: Check Application Status | ||
needs: docker_build_and_push | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check the deployed service URL | ||
uses: jtalk/url-health-check-action@v3 | ||
with: | ||
url: https://api.poapper.club|https://api-dev.poapper.club | ||
follow-redirect: true | ||
max-attempts: 3 | ||
retry-delay: 10s |
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
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
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,42 @@ | ||
version: '3.3' | ||
services: | ||
dev: | ||
image: 151345152001.dkr.ecr.ap-northeast-2.amazonaws.com/poapper-api:latest | ||
ports: | ||
- 6001:4000 | ||
secrets: | ||
- source: poapper_api_dot_env | ||
target: /usr/src/app/.env | ||
logging: | ||
driver: local | ||
options: | ||
max-size: 10m | ||
deploy: | ||
labels: | ||
swarmpit.service.deployment.autoredeploy: 'true' | ||
placement: | ||
constraints: | ||
- node.role != manager | ||
- node.labels.application == poapper_web | ||
prod: | ||
image: 151345152001.dkr.ecr.ap-northeast-2.amazonaws.com/poapper-api:vX.X.X | ||
ports: | ||
- 4001:4000 | ||
secrets: | ||
- source: poapper_api_dot_env | ||
target: /usr/src/app/.env | ||
logging: | ||
driver: local | ||
options: | ||
max-size: 10m | ||
deploy: | ||
labels: | ||
swarmpit.service.deployment.autoredeploy: 'true' | ||
placement: | ||
constraints: | ||
- node.role != manager | ||
- node.labels.application == poapper_web | ||
|
||
secrets: | ||
poapper_api_dot_env: | ||
external: true |
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,11 @@ | ||
server { | ||
server_name api-dev.poapper.club; | ||
client_max_body_size 10M; | ||
|
||
location / { | ||
proxy_pass http://localhost:6001; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
} | ||
} |
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,11 @@ | ||
server { | ||
server_name api.poapper.club; | ||
client_max_body_size 10M; | ||
|
||
location / { | ||
proxy_pass http://localhost:4001; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
} | ||
} |
Oops, something went wrong.