Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
0dad3a1
add my name to README
Mar 11, 2026
8d4cafe
Merge pull request #1 from khaled-sadlah/addtests
khaled-sadlah Mar 11, 2026
ba7542e
add tests branch
Mar 11, 2026
f50619c
add tests branch
Mar 11, 2026
e6e6961
Merge pull request #2 from khaled-sadlah/addtests
khaled-sadlah Mar 11, 2026
4397735
add test
Mar 11, 2026
36fbb6f
add badge to README
Mar 13, 2026
36dfd60
Merge pull request #5 from khaled-sadlah/addtests-fix
khaled-sadlah Mar 13, 2026
dfa9343
add style job to ci
Mar 13, 2026
f0410de
Merge pull request #6 from khaled-sadlah/addtests-fix
khaled-sadlah Mar 13, 2026
e70b15c
ci update
Mar 13, 2026
8a490c3
add ci workflow
Mar 13, 2026
17234cf
Merge branch 'main' into ci-update
Mar 13, 2026
dce89cd
add test script
Mar 13, 2026
8a6a3b0
install vitest
Mar 13, 2026
37c848c
fix ci workflow
Mar 13, 2026
3659b45
add basic test
Mar 13, 2026
8c92a54
fix lockfile
Mar 13, 2026
1829c77
regenerate lockfile
Mar 13, 2026
f11e63e
replace vitest with node test runner
Mar 13, 2026
269d623
fix ci
Mar 13, 2026
3cc28e2
add eslint and fix lint issues
Mar 13, 2026
b319b6e
add lint step to CI
Mar 13, 2026
b8fc6b3
fix ci trigger
Mar 13, 2026
8c2c66b
fail CI on eslint warnings
Mar 13, 2026
f4e55ef
add security lint check
Mar 13, 2026
c6e9668
fix security warnings
Mar 13, 2026
f32e4af
add CD workflow
Mar 13, 2026
8783d2a
use npm run test in CI
Mar 13, 2026
aedaa3e
add gcp auth for docker build
Mar 14, 2026
d7553a7
deploy notely to cloud run
Mar 14, 2026
627fa82
run migrations in cd workflow
Mar 14, 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
44 changes: 44 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
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

- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'

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

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

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

- name: Deploy to Cloud Run
run: gcloud run deploy notely --image us-central1-docker.pkg.dev/notely-490113/notely-ar-repo/notely:latest --region us-central1 --allow-unauthenticated --project notely-490113 --max-instances=4
46 changes: 46 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
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 tests
run: npm run test

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: Run lint
run: npm run lint -- --max-warnings=0
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
![CI Tests](https://github.com/khaled-sadlah/learn-cicd-typescript-starter/actions/workflows/ci.yml/badge.svg)

# learn-cicd-typescript-starter (Notely)

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,7 @@ 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!
Khaled's version of Boot.dev's Notely app.
test
test
fix
1 change: 1 addition & 0 deletions ci-notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# CI Update
24 changes: 24 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
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([
{
ignores: ["dist/**", "coverage/**", "node_modules/**"]
},
{
files: ["**/*.{js,mjs,cjs,ts,mts,cts}"],
plugins: { js },
extends: ["js/recommended"]
},
{
files: ["**/*.{js,mjs,cjs,ts,mts,cts}"],
languageOptions: {
globals: globals.node
}
},
tseslint.configs.recommended,
pluginSecurity.configs.recommended
]);
Loading