Thomas G. Lopes
commited on
Commit
·
39ca151
1
Parent(s):
e784134
update ci
Browse files- .github/workflows/lint-and-test.yml +20 -8
- Dockerfile +9 -6
.github/workflows/lint-and-test.yml
CHANGED
@@ -4,24 +4,36 @@ on:
|
|
4 |
push:
|
5 |
branches:
|
6 |
- main
|
7 |
-
|
8 |
jobs:
|
9 |
lint:
|
10 |
runs-on: ubuntu-latest
|
11 |
timeout-minutes: 10
|
12 |
-
|
13 |
steps:
|
14 |
- uses: actions/checkout@v3
|
15 |
-
|
16 |
- uses: actions/setup-node@v3
|
17 |
with:
|
18 |
node-version: "20"
|
19 |
-
|
20 |
-
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
- name: "Checking lint/format errors"
|
23 |
run: |
|
24 |
-
|
25 |
- name: "Checking type errors"
|
26 |
run: |
|
27 |
-
|
|
|
4 |
push:
|
5 |
branches:
|
6 |
- main
|
|
|
7 |
jobs:
|
8 |
lint:
|
9 |
runs-on: ubuntu-latest
|
10 |
timeout-minutes: 10
|
|
|
11 |
steps:
|
12 |
- uses: actions/checkout@v3
|
|
|
13 |
- uses: actions/setup-node@v3
|
14 |
with:
|
15 |
node-version: "20"
|
16 |
+
- name: Install pnpm
|
17 |
+
uses: pnpm/action-setup@v2
|
18 |
+
with:
|
19 |
+
version: latest
|
20 |
+
run_install: false
|
21 |
+
- name: Get pnpm store directory
|
22 |
+
id: pnpm-cache
|
23 |
+
shell: bash
|
24 |
+
run: |
|
25 |
+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
|
26 |
+
- uses: actions/cache@v3
|
27 |
+
with:
|
28 |
+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
29 |
+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
30 |
+
restore-keys: |
|
31 |
+
${{ runner.os }}-pnpm-store-
|
32 |
+
- name: Install dependencies
|
33 |
+
run: pnpm install --frozen-lockfile
|
34 |
- name: "Checking lint/format errors"
|
35 |
run: |
|
36 |
+
pnpm run lint
|
37 |
- name: "Checking type errors"
|
38 |
run: |
|
39 |
+
pnpm run check
|
Dockerfile
CHANGED
@@ -1,22 +1,25 @@
|
|
1 |
FROM node:alpine
|
2 |
|
|
|
|
|
|
|
3 |
# Set the working directory
|
4 |
WORKDIR /app
|
5 |
|
6 |
-
# Copy package.json and pnpm-lock.yaml
|
7 |
-
COPY package.json
|
8 |
|
9 |
# Install all dependencies, including dev dependencies
|
10 |
-
RUN
|
11 |
|
12 |
# Copy the rest of the application code
|
13 |
COPY . .
|
14 |
|
15 |
# Build the application
|
16 |
-
RUN
|
17 |
|
18 |
# Prune dev dependencies
|
19 |
-
RUN
|
20 |
|
21 |
# Set correct permissions
|
22 |
RUN chown -R node:node /app
|
@@ -28,4 +31,4 @@ USER node
|
|
28 |
EXPOSE 3000
|
29 |
|
30 |
# Start the application
|
31 |
-
CMD ["node", "build"]
|
|
|
1 |
FROM node:alpine
|
2 |
|
3 |
+
# Install pnpm
|
4 |
+
RUN npm install -g pnpm
|
5 |
+
|
6 |
# Set the working directory
|
7 |
WORKDIR /app
|
8 |
|
9 |
+
# Copy package.json and pnpm-lock.yaml
|
10 |
+
COPY package.json pnpm-lock.yaml* ./
|
11 |
|
12 |
# Install all dependencies, including dev dependencies
|
13 |
+
RUN pnpm install --frozen-lockfile
|
14 |
|
15 |
# Copy the rest of the application code
|
16 |
COPY . .
|
17 |
|
18 |
# Build the application
|
19 |
+
RUN pnpm run build
|
20 |
|
21 |
# Prune dev dependencies
|
22 |
+
RUN pnpm prune --prod
|
23 |
|
24 |
# Set correct permissions
|
25 |
RUN chown -R node:node /app
|
|
|
31 |
EXPOSE 3000
|
32 |
|
33 |
# Start the application
|
34 |
+
CMD ["node", "build"]
|