Skip to content

Commit 4a740b3

Browse files
committed
migrate dev environment
1 parent dd72903 commit 4a740b3

4 files changed

Lines changed: 55 additions & 28 deletions

File tree

.github/workflows/cd.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/workflows/dev-cd.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Develop CD workflow
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- develop
8+
9+
jobs:
10+
dev-cd:
11+
uses: lemoncode/actions/.github/workflows/aws-ebs.yml@main
12+
with:
13+
files-to-zip: "back/** back/.babelrc front/** front/.babelrc Dockerfile .dockerignore"
14+
dockerArgs: "BASE_API_URL=https://dev.codepaster.net \
15+
BASE_SOCKET_URL=https://dev.codepaster.net"
16+
secrets:
17+
AWS_EB_APP_NAME: ${{secrets.DEV_AWS_EB_APP_NAME}}
18+
AWS_EB_ENV_NAME: ${{secrets.DEV_AWS_EB_ENV_NAME}}
19+
AWS_DEPLOY_ACCESS_KEY_ID: ${{secrets.DEV_AWS_DEPLOY_ACCESS_KEY_ID}}
20+
AWS_DEPLOY_SECRET_ACCESS_KEY: ${{secrets.DEV_AWS_DEPLOY_SECRET_ACCESS_KEY}}
21+
AWS_REGION: ${{secrets.DEV_AWS_REGION}}
22+
AWS_DEPLOY_S3_BUCKET: ${{secrets.DEV_AWS_DEPLOY_S3_BUCKET}}

.github/workflows/prod-cd.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Production CD workflow
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
dev-cd:
11+
uses: lemoncode/actions/.github/workflows/aws-ebs.yml@main
12+
with:
13+
files-to-zip: "back/** back/.babelrc front/** front/.babelrc Dockerfile .dockerignore"
14+
dockerArgs: "BASE_API_URL=https://codepaster.net \
15+
BASE_SOCKET_URL=https://codepaster.net"
16+
secrets:
17+
AWS_EB_APP_NAME: ${{secrets.AWS_EB_APP_NAME}}
18+
AWS_EB_ENV_NAME: ${{secrets.AWS_EB_ENV_NAME}}
19+
AWS_DEPLOY_ACCESS_KEY_ID: ${{secrets.AWS_DEPLOY_ACCESS_KEY_ID}}
20+
AWS_DEPLOY_SECRET_ACCESS_KEY: ${{secrets.AWS_DEPLOY_SECRET_ACCESS_KEY}}
21+
AWS_REGION: ${{secrets.AWS_REGION}}
22+
AWS_DEPLOY_S3_BUCKET: ${{secrets.AWS_DEPLOY_S3_BUCKET}}

Dockerfile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,14 @@ COPY ./back/package.json ./
2626
COPY ./back/package-lock.json ./
2727
RUN npm ci --only=production
2828

29-
ENTRYPOINT [ "node", "index" ]
29+
EXPOSE 3000
30+
ENV PORT=3000
31+
ENV NODE_ENV=production
32+
ENV STATIC_FILES_PATH=./public
33+
ENV MOCK_REPOSITORY=false
34+
ENV CORS_ORIGIN=false
35+
ENV API_URL=/api
36+
37+
RUN npm i pm2 -g
38+
39+
CMD pm2 start ./index.js --name "app" --env production --no-daemon

0 commit comments

Comments
 (0)