-
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
1 parent
1e178a0
commit 45051b4
Showing
6 changed files
with
90 additions
and
144 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,7 @@ | ||
#!/bin/bash | ||
|
||
echo "Applying Database Migrations" | ||
/app/node_modules/.bin/prisma migrate deploy | ||
|
||
echo "Starting Application" | ||
node /app/lib/servers/graphql-main.js |
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: Build and Push Docker image | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'deployment-ci' | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/my-app:latest |
This file was deleted.
Oops, something went wrong.
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: Spinup Server | ||
|
||
on: | ||
push: | ||
branches: ['deployment-ci'] | ||
|
||
jobs: | ||
spinup-server: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '16' | ||
|
||
- name: Install direnv | ||
run: sudo apt-get install direnv -y | ||
|
||
- name: Install dependencies | ||
run: yarn install | ||
|
||
- name: Build the app | ||
run: yarn build | ||
|
||
- name: Run Server & Get Healthz | ||
run: | | ||
. ./.envrc && yarn start & | ||
sleep 5 | ||
curl --fail http://localhost:4000/healthz |
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,10 +1,23 @@ | ||
FROM node:18 | ||
FROM node:18 AS BUILD_IMAGE | ||
|
||
WORKDIR /app | ||
|
||
# Install dependencies | ||
COPY *.json ./yarn.lock ./ | ||
COPY . . | ||
RUN yarn install --frozen-lockfile | ||
|
||
# Run Source Code | ||
COPY . . | ||
# Build Source Code | ||
COPY ./src ./src | ||
RUN yarn build | ||
RUN yarn install --frozen-lockfile --production | ||
|
||
FROM node:16 | ||
COPY --from=BUILD_IMAGE /app/lib /app/lib | ||
COPY --from=BUILD_IMAGE /app/node_modules /app/node_modules | ||
COPY --from=BUILD_IMAGE /app/prisma /app/prisma | ||
COPY --from=BUILD_IMAGE /app/.docker/scripts /app/.docker/scripts | ||
|
||
WORKDIR /app | ||
COPY ./*.js ./package.json ./tsconfig.json ./yarn.lock ./default.yaml ./ | ||
|
||
CMD [".docker/scripts/start.sh"] |
This file was deleted.
Oops, something went wrong.