From 3b431f69e48bdd70543ac6f4dd9d698ce35d165e Mon Sep 17 00:00:00 2001 From: kanghyuk Date: Tue, 4 Jun 2024 19:29:27 +0900 Subject: [PATCH] ACTION :: xquare deploy --- .github/workflows/xquare.yml | 46 ++++++++++++++++++++++++++++ .xquare/config.yaml | 7 +++++ Dockerfile | 58 ++++++++++++++++++++++++++++++++++-- 3 files changed, 109 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/xquare.yml create mode 100644 .xquare/config.yaml diff --git a/.github/workflows/xquare.yml b/.github/workflows/xquare.yml new file mode 100644 index 0000000..e1fb75d --- /dev/null +++ b/.github/workflows/xquare.yml @@ -0,0 +1,46 @@ +name: xquare-deployment + +on: + push: + branches: [ "main" ] + +jobs: + deploy: + permissions: + id-token: write + contents: read + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + + - name: Deploy to xquare + uses: team-xquare/xquare-deployment-action@master + with: + environment: prod + access_key: ${{ secrets.XQUARE_ACCESS_KEY }} + github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + buildargs: | + PROFILE=prod + REDIS_HOST=${{ secrets.REDIS_HOST }} + REDIS_USERNAME=${{ secrets.REDIS_USERNAME }} + REDIS_PORT=${{ secrets.REDIS_PORT }} + DB_HOST=${{ secrets.DB_HOST }} + DB_USERNAME=${{ secrets.DB_USERNAME }} + DB_PASSWORD=${{ secrets.DB_PASSWORD }} + DB_NAME=${{ secrets.DB_NAME }} + DB_PORT=${{ secrets.DB_PORT }} + PORT=${{ secrets.PORT }} + SECRET_KEY=${{ secrets.SECRET_KEY }} + AC_TOKEN_EXP=${{ secrets.AC_TOKEN_EXP }} + RF_TOKEN_EXP=${{ secrets.RF_TOKEN_EXP }} + REDIS_PORT=${{ secrets.REDIS_PORT }} + OAUTH_GOOGLE_ID=${{ secrets.OAUTH_GOOGLE_ID }} + KAKAO_CLIENT_ID=${{ secrets.KAKAO_CLIENT_ID }} + KAKAO_SECRET_KEY=${{ secrets.KAKAO_SECRET_KEY }} + KAKAO_REDIRECT_URI=${{ secrets.KAKAO_REDIRECT_URI }} + AWS_S3_BUCKET_NAME=${{ secrets.AWS_S3_BUCKET_NAME }} + AWS_ACCESS_KEY=${{ secrets.AWS_ACCESS_KEY }} + AWS_SECRET_KEY=${{ secrets.AWS_SECRET_KEY }} \ No newline at end of file diff --git a/.xquare/config.yaml b/.xquare/config.yaml new file mode 100644 index 0000000..6355726 --- /dev/null +++ b/.xquare/config.yaml @@ -0,0 +1,7 @@ +config: + name: propofol + service_type: be + port: 80 + domain: + stag: p-stag.xquare.app + prod: propofol.xquare.app \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 595d6d2..ebd4385 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,7 +22,61 @@ WORKDIR /app COPY --chown=node:node --from=build /app/node_modules ./node_modules COPY --chown=node:node --from=build /app/dist ./dist -ARG NODE_ENV=production -ENV NODE_ENV NODE_ENV +ARG PROFILE +ENV NODE_ENV ${PROFILE} + +ARG REDIS_HOST +ENV REDIS_HOST ${REDIS_HOST} + +ARG REDIS_PORT +ENV REDIS_PORT ${REDIS_PORT} + +ARG DB_HOST +ENV DB_HOST ${DB_HOST} + +ARG DB_USERNAME +ENV DB_USERNAME ${DB_USERNAME} + +ARG DB_PASSWORD +ENV DB_PASSWORD ${DB_PASSWORD} + +ARG DB_NAME +ENV DB_NAME ${DB_NAME} + +ARG DB_PORT +ENV DB_PORT ${DB_PORT} + +ARG PORT +ENV PORT ${PORT} + +ARG SECRET_KEY +ENV SECRET_KEY ${SECRET_KEY} + +ARG AC_TOKEN_EXP +ENV AC_TOKEN_EXP ${AC_TOKEN_EXP} + +ARG RF_TOKEN_EXP +ENV RF_TOKEN_EXP ${RF_TOKEN_EXP} + +ARG OAUTH_GOOGLE_ID +ENV OAUTH_GOOGLE_ID ${OAUTH_GOOGLE_ID} + +ARG KAKAO_CLIENT_ID +ENV KAKAO_CLIENT_ID ${KAKAO_CLIENT_ID} + +ARG KAKAO_SECRET_KEY +ENV KAKAO_SECRET_KEY ${KAKAO_SECRET_KEY} + +ARG KAKAO_REDIRECT_URI +ENV KAKAO_REDIRECT_URI ${KAKAO_REDIRECT_URI} + +ARG AWS_S3_BUCKET_NAME +ENV AWS_S3_BUCKET_NAME ${AWS_S3_BUCKET_NAME} + +ARG AWS_ACCESS_KEY +ENV AWS_ACCESS_KEY ${AWS_ACCESS_KEY} + +ARG AWS_SECRET_KEY +ENV AWS_SECRET_KEY ${AWS_SECRET_KEY} CMD ["node", "dist/main.js"]