Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
c4d0d84
Add my name to README
YoSSalam8 Mar 15, 2026
734d24a
Add CI workflow
YoSSalam8 Mar 15, 2026
08bd4ed
Fix CI workflow to check node version
YoSSalam8 Mar 15, 2026
877f20f
Add vitest tests for getAPIKey
YoSSalam8 Mar 15, 2026
9685a73
Add tests for getAPIKey
YoSSalam8 Mar 15, 2026
65ac25f
Test CI failure
YoSSalam8 Mar 15, 2026
22e7bf9
Run tests in CI
YoSSalam8 Mar 15, 2026
45c0923
Add coverage reporting to CI
YoSSalam8 Mar 15, 2026
e26201d
Add CI badge to README
YoSSalam8 Mar 15, 2026
7a418ab
Merge pull request #1 from YoSSalam8/addtests
YoSSalam8 Mar 15, 2026
3772f06
Add prettier formatting
YoSSalam8 Mar 16, 2026
fa0d90c
Add formatting check to CI
YoSSalam8 Mar 16, 2026
4e3d1df
Fix eslint config
YoSSalam8 Mar 16, 2026
caa198f
Add lint step to CI
YoSSalam8 Mar 16, 2026
8354e51
Fix lint error
YoSSalam8 Mar 16, 2026
65df5ba
Fix formatting in main.ts
YoSSalam8 Mar 16, 2026
3b62baa
Fail CI on lint warnings
YoSSalam8 Mar 16, 2026
7b47c2b
Fix security lint issues
YoSSalam8 Mar 16, 2026
db4840e
Fix security warning and CI style job
YoSSalam8 Mar 16, 2026
b5ff2b0
Add CD workflow
YoSSalam8 Mar 16, 2026
2ae7f1a
Merge pull request #2 from YoSSalam8/addtests
YoSSalam8 Mar 16, 2026
5b46280
Add CD workflow
YoSSalam8 Mar 16, 2026
1cd8964
Merge pull request #3 from YoSSalam8/addtests
YoSSalam8 Mar 16, 2026
2399146
Automate Docker builds with GCP
YoSSalam8 Mar 16, 2026
f36bef7
Merge pull request #4 from YoSSalam8/addtests
YoSSalam8 Mar 16, 2026
511e227
Deploy Notely updates to Cloud Run
YoSSalam8 Mar 16, 2026
c784a4e
Merge pull request #5 from YoSSalam8/addtests
YoSSalam8 Mar 16, 2026
5e42ad2
Run database migrations in CD
YoSSalam8 Mar 16, 2026
89b40b0
Merge pull request #6 from YoSSalam8/addtests
YoSSalam8 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
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-490411/notely-ar-repo/notely:latest .

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

- name: Deploy to Cloud Run
run: gcloud run deploy notely --image us-central1-docker.pkg.dev/notely-490411/notely-ar-repo/notely:latest --region us-central1 --allow-unauthenticated --project notely-490411 --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 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
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
![CI Tests](https://github.com/YoSSalam8/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,6 @@ 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!

Yousef's version of Boot.dev's Notely app.

22 changes: 22 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
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,
]);
Empty file.
Empty file added npx
Empty file.
Loading