-
Notifications
You must be signed in to change notification settings - Fork 15
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
3 changed files
with
53 additions
and
1 deletion.
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: Build and Deploy to Docker Hub | ||
|
||
on: | ||
push: | ||
branches: | ||
- master # Adjusted to trigger on pushes to master | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check Out Repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Prepare Dockerfile | ||
run: cp ./docker/Dockerfile.user ./Dockerfile | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Build and Push Docker image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: true | ||
tags: 100xdevs/web-app:latest | ||
|
||
- name: Verify Pushed Image | ||
run: docker pull 100xdevs/web-app: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,18 @@ | ||
FROM node:20.12.0-alpine3.19 | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY package.json package-lock.json turbo.json tsconfig.json ./ | ||
|
||
COPY apps ./apps | ||
COPY packages ./packages | ||
|
||
# Install dependencies | ||
RUN npm install | ||
# Can you add a script to the global package.json that does this? | ||
RUN cd packages/db && npx prisma generate && cd ../.. | ||
|
||
# Can you filter the build down to just one app? | ||
RUN npm run build | ||
|
||
CMD ["npm", "run", "start-user-app"] |
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