This repository has been archived by the owner on Jul 2, 2023. It is now read-only.
generated from aslupin/boilerplate-typescript-fastify-clean-architecture
-
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
2 changed files
with
60 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: "Push Image (Production)" | ||
|
||
on: | ||
push: | ||
branches: | ||
- prod-release-image | ||
jobs: | ||
build: | ||
name: Cloud Run Deployment | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@master | ||
|
||
- name: Setup GCP Service Account | ||
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master | ||
with: | ||
version: "latest" | ||
service_account_email: ${{ secrets.GCP_SA_EMAIL }} | ||
service_account_key: ${{ secrets.GCP_SA_KEY }} | ||
export_default_credentials: true | ||
|
||
- name: Configure Docker | ||
run: | | ||
gcloud auth configure-docker | ||
- name: Build | ||
run: | | ||
docker build -f ./docker/prod.Dockerfile . -t asia.gcr.io/${{ secrets.GCP_PROJECT_ID }}/${{ secrets.GCR_IMAGE_NAME }} | ||
- name: Push | ||
run: | | ||
docker push asia.gcr.io/${{ secrets.GCP_PROJECT_ID }}/${{ secrets.GCR_IMAGE_NAME }}:latest |
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,27 @@ | ||
# Building stage | ||
FROM node:14.2 as builder | ||
WORKDIR /usr/src/app | ||
|
||
ARG GIT_ACCESS_TOKEN_CURL_CONFIG | ||
|
||
COPY *.sh *.json *.js Makefile ./ | ||
COPY src src/ | ||
COPY config config/ | ||
|
||
RUN curl -o production.yml https://${GIT_ACCESS_TOKEN_CURL_CONFIG}@raw.githubusercontent.com/logpost/logpost-environment/master/environment/carrier-management-service/production.yml | ||
RUN curl -o development.yml https://${GIT_ACCESS_TOKEN_CURL_CONFIG}@raw.githubusercontent.com/logpost/logpost-environment/master/environment/carrier-management-service/development.yml | ||
RUN curl -o staging.yml https://${GIT_ACCESS_TOKEN_CURL_CONFIG}@raw.githubusercontent.com/logpost/logpost-environment/master/environment/carrier-management-service/staging.yml | ||
RUN mv -f production.yml staging.yml development.yml config | ||
|
||
RUN npm ci | ||
RUN npm run build | ||
|
||
# Starting stage | ||
FROM node:14.2-slim | ||
WORKDIR /usr/src/app | ||
COPY --from=builder /usr/src/app/node_modules node_modules/ | ||
COPY --from=builder /usr/src/app/dist dist/ | ||
COPY --from=builder /usr/src/app/config config/ | ||
COPY --from=builder /usr/src/app/package.json . | ||
EXPOSE 8081 8081 | ||
CMD [ "npm", "run", "start:prod"] |