Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
bd61ad4
Add my version note to readme file
JalilaMuadi Mar 9, 2026
4a05e7a
Add my version note to README
JalilaMuadi Mar 9, 2026
212d4eb
Add basic CI work flow
JalilaMuadi Mar 9, 2026
3f1abf6
Update CI step to show node version
JalilaMuadi Mar 9, 2026
48a8ff1
Breaka getAPIkey to test
JalilaMuadi Mar 9, 2026
4aa59f6
Breaka getAPIkey to test CI failure
JalilaMuadi Mar 9, 2026
b73b5b3
Breaka getAPIkey to test CI failure
JalilaMuadi Mar 9, 2026
5519718
Fix getAPIKey
JalilaMuadi Mar 9, 2026
c172e03
Add code coverage reporting to ci
JalilaMuadi Mar 9, 2026
b35d7f0
Add @vitest/coverage-v8 for code coverage
JalilaMuadi Mar 9, 2026
182f4dd
Add CI test badge to README
JalilaMuadi Mar 9, 2026
243e54a
Merge pull request #1 from JalilaMuadi/addtests
JalilaMuadi Mar 9, 2026
6d174c6
Add formatting check as a separate CI job
JalilaMuadi Mar 9, 2026
6498705
Add format:check and format:write scripts
JalilaMuadi Mar 9, 2026
1a8706b
Add ESlint linting
JalilaMuadi Mar 10, 2026
45c0fff
Add linting step to CI
JalilaMuadi Mar 10, 2026
2cf92eb
Remove unused function
JalilaMuadi Mar 10, 2026
140abe8
Fail CI on lint warnings
JalilaMuadi Mar 10, 2026
03b83e9
Fix security warnings
JalilaMuadi Mar 10, 2026
ed111bd
Fix security warnings
JalilaMuadi Mar 10, 2026
8ccb9f3
New update
JalilaMuadi Mar 10, 2026
102f4fc
Merge pull request #2 from JalilaMuadi/addtests
JalilaMuadi Mar 10, 2026
e5a21e4
Merge branch 'bootdotdev:main' into main
JalilaMuadi Mar 23, 2026
623dcd8
feat: setup docker and cd workflow
JalilaMuadi Mar 23, 2026
e47125d
update h1 and add deploy step
JalilaMuadi Mar 23, 2026
ba8c1ba
update h1
JalilaMuadi Mar 23, 2026
2aad02e
feat: enable automatic database migrations in cd
JalilaMuadi Mar 23, 2026
a4d4fb2
enable automatic database migrations in cd
JalilaMuadi Mar 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist
node_modules

49 changes: 49 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: cd

on:
push:
branches: [main]

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest

env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}

steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install dependencies
run: npm ci

- name: Build app
run: npm run build

#Run database migrations
- name: Run migrations
run: npm run db:migrate

- id: auth
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_CREDENTIALS }}

- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2

- name: Use gcloud CLI
run: gcloud info

- name: Build and push Docker image
run: gcloud builds submit --tag us-central1-docker.pkg.dev/notely-491114/notely-ar-repo/notely:latest .

- name: Deploy to Cloud Run
run: gcloud run deploy notely --image us-central1-docker.pkg.dev/notely-491114/notely-ar-repo/notely:latest --region us-central1 --allow-unauthenticated --project notely-491114 --max-instances=4
47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: ci

on:
pull_request:
branches: [main]

jobs:
tests:
name: Tests
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install dependencies
run: npm ci

- name: Run unit tests
run: npm run test -- --coverage

style:
name: Style
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install dependencies
run: npm ci

- name: Check formatting
run: npm run format:check

- name: Check linting
run: npm run lint -- --max-warnings=0
9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
*.tar.gz
google-cloud-sdk/
Installation directory*/
venv/
.venv/
node_modules/
coverage/
dist/
.env
.vscode
.env
20 changes: 16 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
FROM --platform=linux/amd64 node:22-slim
# Base image
FROM node:22-alpine

WORKDIR /usr/src/app
# Set working directory
WORKDIR /app

ADD . .
# Copy package files
COPY package*.json ./

# Install dependencies
RUN npm ci

# Copy source code
COPY . .

# Build app
RUN npm run build

CMD ["node", "dist/main.js"]
# Expose port
EXPOSE 8080

# Start server
CMD ["npm", "run", "dev"]
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# learn-cicd-typescript-starter (Notely)
# Notely App

![CI Tests](https://github.com/JalilaMuadi/learn-cicd-typescript-starter/actions/workflows/ci.yml/badge.svg)

This repo contains the typescript starter code for the "Notely" application for the "Learn CICD" course on [Boot.dev](https://boot.dev).

Expand All @@ -22,3 +24,5 @@ npm run dev
_This starts the server in non-database mode._ It will serve a simple webpage at `http://localhost:8080`.

You do _not_ need to set up a database or any interactivity on the webpage yet. Instructions for that will come later in the course!

Jalila's version of Boot.dev's Notely app..
17 changes: 17 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import js from "@eslint/js";
import globals from "globals";
import tseslint from "typescript-eslint";
import { defineConfig } from "eslint/config";
import pluginSecurity from "eslint-plugin-security";

export default defineConfig([
{
files: ["**/*.{js,mjs,cjs,ts,mts,cts}"],
plugins: { js },
extends: ["js/recommended"],
languageOptions: { globals: globals.browser },
ignores: ["dist/**"],
},
tseslint.configs.recommended,
pluginSecurity.configs.recommended,
]);
Loading