Skip to content

Commit 4c16c34

Browse files
authored
Merge pull request #21 from tglima/v1.0
V1.0
2 parents 75bac08 + 36952af commit 4c16c34

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+80
-11
lines changed

src/.babelrc renamed to .babelrc

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

.github/workflows/main-pr-automated-tests.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,9 @@ jobs:
1919

2020
- name: Install dependencies
2121
run: npm i --exact
22-
working-directory: ./src
2322

2423
- name: Run tests
2524
run: npm test || exit 1
26-
working-directory: ./src
2725

2826
- name: Comment on Pull Request
2927
if: ${{ success() }}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Create dist and docker build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
jobs:
8+
build-project-generate-docker-image:
9+
runs-on: ubuntu-latest
10+
env:
11+
GH_TOKEN: ${{ github.token }}
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4.1.0
16+
17+
- name: Use Node.js
18+
uses: actions/setup-node@v3
19+
with:
20+
node-version: '18.x'
21+
22+
- name: Install project dependencies
23+
run: npm i --exact
24+
25+
- name: Build project
26+
run: npm run build
27+
28+
- name: Set Timezone
29+
run: sudo timedatectl set-timezone America/Sao_Paulo
30+
31+
- name: Set VERSION and DATE
32+
id: set-vars
33+
run: |
34+
echo "::set-output name=VERSION::$(node -p "require('./package.json').version")"
35+
echo "::set-output name=DATE::$(date +'%Y-%m-%d-%H-%M')"
36+
37+
- name: Create GitHub Release
38+
id: create-release
39+
uses: actions/create-release@v1
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
with:
43+
tag_name: v${{ steps.set-vars.outputs.VERSION }}
44+
release_name: Release v${{ steps.set-vars.outputs.VERSION }}
45+
draft: false
46+
prerelease: false
47+
48+
- name: Build dist zip
49+
uses: vimtor/action-zip@v1.1
50+
with:
51+
files: dist/
52+
dest: dist_v${{ steps.set-vars.outputs.VERSION }}_${{ steps.set-vars.outputs.DATE }}.zip
53+
54+
- name: Upload Zip
55+
run: gh release upload v${{ steps.set-vars.outputs.VERSION }} dist_v${{ steps.set-vars.outputs.VERSION }}_${{ steps.set-vars.outputs.DATE }}.zip
56+
57+
- name: Login to Docker Hub
58+
uses: docker/login-action@v3.0.0
59+
with:
60+
username: ${{ secrets.DOCKER_USERNAME }}
61+
password: ${{ secrets.DOCKER_PASSWORD }}
62+
63+
- name: Build and push Docker image
64+
uses: docker/build-push-action@v5.0.0
65+
with:
66+
context: ./dist
67+
file: ./dist/Dockerfile
68+
push: true
69+
tags: |
70+
tglimatech/github-restapi-node-docker:${{ steps.set-vars.outputs.VERSION }}
71+
tglimatech/github-restapi-node-docker:latest
File renamed without changes.

.vscode/launch.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
"command": "npm run dev",
1010
"request": "launch",
1111
"type": "node-terminal",
12-
"cwd": "${workspaceFolder}/src",
13-
"envFile": "${workspaceFolder}/src/app/config/develop.env",
12+
"cwd": "${workspaceFolder}",
13+
"envFile": "${workspaceFolder}/app/config/develop.env",
1414
"skipFiles": [
1515
"<node_internals>/**"
16-
],
16+
],
1717
}
1818
]
19-
}
19+
}

src/Dockerfile renamed to Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ RUN apk add --no-cache nano
3232
RUN npm install -g npm@10.2.3
3333

3434
# Instale apenas as dependências de produção do projeto
35-
RUN npm install --omit=dev --exact
35+
RUN npm ci --omit=dev
3636

3737
# Exponha a porta configurada
3838
EXPOSE $NU_PORT

0 commit comments

Comments
 (0)