Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
b81b1fb
added mtmy name
Mar 13, 2026
8c3c425
added tests
Mar 13, 2026
f4407bc
fixed the exit-1 failure
Mar 13, 2026
1d2dbb9
adding broken code
Mar 13, 2026
2a597c5
adding broken code2
Mar 13, 2026
6b4fba1
adding broken code3
Mar 13, 2026
f99c159
adding broken code4
Mar 13, 2026
ff985a2
adding broken code5
Mar 13, 2026
2c30f99
adding fixed code
Mar 13, 2026
c5ba5d4
added a package - vitest
Mar 13, 2026
45f9bda
added coverage
Mar 14, 2026
7167c8c
added badge to readme
Mar 14, 2026
55b5f27
added badge to readme
Mar 14, 2026
a3a2a5b
Merge pull request #1 from Ruaa-Maher-Faroun/addtests
Ruaa-Maher-Faroun Mar 14, 2026
deb4ab3
changed the ci file
Mar 14, 2026
a78783b
add style job to CI
Mar 14, 2026
cd9121f
added lint with error
Mar 14, 2026
839d314
added lint without error
Mar 14, 2026
da7a9bf
added lint fixed error
Mar 14, 2026
6451033
added lint fixed format
Mar 14, 2026
656511d
added security issues
Mar 14, 2026
ac308ac
added security error
Mar 14, 2026
c83026c
added security - fixed error
Mar 14, 2026
fcb1807
continuous deployment test
Mar 14, 2026
373bd18
Merge pull request #2 from Ruaa-Maher-Faroun/addtests
Ruaa-Maher-Faroun Mar 14, 2026
b582152
fixed cd.tml
Mar 14, 2026
d3ed3a2
Merge pull request #3 from Ruaa-Maher-Faroun/addtests
Ruaa-Maher-Faroun Mar 14, 2026
42ddcab
clean CI/CD setup
Mar 16, 2026
63aa5ed
adding build for the 100th time
Mar 16, 2026
cbe0529
Merge pull request #5 from Ruaa-Maher-Faroun/clean-fix
Ruaa-Maher-Faroun Mar 16, 2026
05adcbe
added deployment to cd
Mar 16, 2026
b743733
Merge pull request #6 from Ruaa-Maher-Faroun/clean-fix
Ruaa-Maher-Faroun Mar 16, 2026
6c9ce6e
Add DATABASE_URL secret and run migrations in CD
Mar 16, 2026
2b16d60
Merge pull request #7 from Ruaa-Maher-Faroun/clean-fix
Ruaa-Maher-Faroun Mar 16, 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
46 changes: 46 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
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
with:
project_id: notely-490220

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

- 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-490220/notely-ar-repo/notely:v1 --region us-central1 --allow-unauthenticated --project notely-490220 --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 the 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: Run formatting check
run: npm run format:check

- name: Check linting
run: npm run lint -- --max-warnings=0
13 changes: 11 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
node_modules/
coverage/
dist/
coverage/

.env
.vscode
.env.*

.vscode/

*.log
*.tar.gz

google-cloud-cli-linux-x86_64.tar.gz
google-cloud-sdk/
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
![CI Tests](https://github.com/Ruaa-Maher-Faroun/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 +25,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!

Ruaa's version of Boot.dev's Notely app.
20 changes: 20 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
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.node }
},
{
files: ["**/*.{js,mjs,cjs,ts,mts,cts}"],
languageOptions: { globals: globals.node },
},

tseslint.configs.recommended,
pluginSecurity.configs.recommended,
]);
Loading