Skip to content

Commit 623dcd8

Browse files
committed
feat: setup docker and cd workflow
1 parent e5a21e4 commit 623dcd8

File tree

5 files changed

+45
-15
lines changed

5 files changed

+45
-15
lines changed

.github/workflows/cd.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,18 @@ jobs:
2222
run: npm ci
2323

2424
- name: Build app
25-
run: npm run build
25+
run: npm run build
26+
27+
- id: auth
28+
uses: google-github-actions/auth@v2
29+
with:
30+
credentials_json: ${{ secrets.GCP_CREDENTIALS }}
31+
32+
- name: Set up Cloud SDK
33+
uses: google-github-actions/setup-gcloud@v2
34+
35+
- name: Use gcloud CLI
36+
run: gcloud info
37+
38+
- name: Build and push Docker image
39+
run: gcloud builds submit --tag us-central1-docker.pkg.dev/notely-491114/notely-ar-repo/notely:latest .

.github/workflows/ci.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,16 @@ jobs:
1818
with:
1919
node-version: 22
2020

21-
- name: ÷Install dependencies
21+
- name: Install dependencies
2222
run: npm ci
2323

24-
- name: Run Tests
24+
- name: Run unit tests
2525
run: npm run test -- --coverage
26+
2627
style:
2728
name: Style
2829
runs-on: ubuntu-latest
30+
2931
steps:
3032
- name: Check out code
3133
uses: actions/checkout@v4
@@ -38,9 +40,8 @@ jobs:
3840
- name: Install dependencies
3941
run: npm ci
4042

41-
- name: Check Formatting
43+
- name: Check formatting
4244
run: npm run format:check
4345

44-
- name: check linting
45-
run: npm run lint -- --max-warnings=0
46-
46+
- name: Check linting
47+
run: npm run lint -- --max-warnings=0

.gitignore

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
*.tar.gz
2+
google-cloud-sdk/
3+
Installation directory*/
4+
venv/
5+
.venv/
16
node_modules/
2-
coverage/
37
dist/
4-
.env
5-
.vscode
8+
.env

Dockerfile

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
1-
FROM --platform=linux/amd64 node:22-slim
1+
# Base image
2+
FROM node:22-alpine
23

3-
WORKDIR /usr/src/app
4+
# Set working directory
5+
WORKDIR /app
46

5-
ADD . .
7+
# Copy package files
8+
COPY package*.json ./
69

10+
# Install dependencies
711
RUN npm ci
812

13+
# Copy source code
14+
COPY . .
15+
16+
# Build app
917
RUN npm run build
1018

11-
CMD ["node", "dist/main.js"]
19+
# Expose port
20+
EXPOSE 8080
21+
22+
# Start server
23+
CMD ["npm", "run", "dev"]

src/tests/auth.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, expect, test } from "vitest";
2-
import { getAPIKey } from "../api/auth";
2+
import { getAPIKey } from "../api/auth.js";
33

44
describe("getAPIKey", () => {
55
test("returns the API key from valid header", () => {

0 commit comments

Comments
 (0)