-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: MatheusVict <[email protected]>
- Loading branch information
1 parent
9f18ae8
commit 729f692
Showing
4 changed files
with
86 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,3 @@ | ||
node_modules | ||
dist | ||
.env |
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,42 @@ | ||
name: Build and Push Docker Image | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Log in to Docker hub | ||
uses: docker/[email protected] | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Build Docker image | ||
run: docker build -t ${{ secrets.DOCKER_USERNAME }}/go_lembrar_server . | ||
|
||
- name: Tag Docker image | ||
run:| | ||
docker tag ${{ secrets.DOCKER_USERNAME }}/go_lembrar_server ${{ secrets.DOCKER_USERNAME }}/go_lembrar_server:latest | ||
docker tag ${{ secrets.DOCKER_USERNAME }}/go_lembrar_server ${{ secrets.DOCKER_USERNAME }}/go_lembrar_server:${{ github.run_id }} | ||
|
||
- name: Push Docker image | ||
run: | | ||
docker push ${{ secrets.DOCKER_USERNAME }}/go_lembrar_server:${{ github.run_id }} | ||
docker push ${{ secrets.DOCKER_USERNAME }}/go_lembrar_server: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,17 @@ | ||
FROM node:18 | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY . . | ||
|
||
COPY ./.env.example ./env | ||
|
||
COPY package*.json ./ | ||
|
||
RUN npm install | ||
|
||
RUN npm run build | ||
|
||
|
||
|
||
CMD [ "npm", "run", "start:prod" ] |
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