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
7db3c8c
Update README with my name
a7mad1112 Mar 1, 2026
f2fcd2c
Add CI workflow
a7mad1112 Mar 1, 2026
0239213
Update CI: show Node version instead of failing
a7mad1112 Mar 1, 2026
d53a13e
Add Vitest tests and CI workflow
a7mad1112 Mar 1, 2026
8b0904c
Break getAPIKey to test CI failure
a7mad1112 Mar 1, 2026
1af663c
test
a7mad1112 Mar 1, 2026
073c2be
e
a7mad1112 Mar 1, 2026
fbf1f40
e
a7mad1112 Mar 1, 2026
f814ed2
test
a7mad1112 Mar 2, 2026
40a0cb1
Merge pull request #2 from a7mad1112/addtests
a7mad1112 Mar 2, 2026
e6995dc
testt coverage
a7mad1112 Mar 2, 2026
5c1866f
run test coverage in yml file
a7mad1112 Mar 2, 2026
ccc362c
run test coverage in yml file
a7mad1112 Mar 2, 2026
7a6d5f8
Add --coverage explicitly to CI workflow
a7mad1112 Mar 2, 2026
ed313ad
Refactor Docker CI workflow for testing
a7mad1112 Mar 2, 2026
02f5bbd
Merge pull request #3 from a7mad1112/main
a7mad1112 Mar 2, 2026
223d008
t
a7mad1112 Mar 2, 2026
7ed3e83
Add CI test badge to README
a7mad1112 Mar 2, 2026
a66fb31
Add Style job to CI workflow
a7mad1112 Mar 3, 2026
9cac171
Configure ESLint ignores using flat config
a7mad1112 Mar 3, 2026
9c4f36f
Add lint step to CI
a7mad1112 Mar 3, 2026
ae60ee6
Remove unused function
a7mad1112 Mar 3, 2026
0c5e59e
Fix formatting
a7mad1112 Mar 3, 2026
6ddebf3
Fail CI on ESLint warnings including security
a7mad1112 Mar 3, 2026
96e292c
Fix security: replace pseudoRandomBytes with randomBytes
a7mad1112 Mar 3, 2026
981515d
e
a7mad1112 Mar 3, 2026
9232a7d
e
a7mad1112 Mar 3, 2026
3cba819
cd
a7mad1112 Mar 3, 2026
5ff232f
Automate GCP Docker build
a7mad1112 Mar 3, 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 @@
node_modules
dist
coverage
42 changes: 42 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Continuous Deployment

on:
push:
branches: [main]

jobs:
Deploy:
runs-on: ubuntu-latest

steps:
# Step 1: Checkout code
- name: Checkout code
uses: actions/checkout@v3

# Step 2: Set up Node.js
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 20

# Step 3: Install dependencies
- name: Install dependencies
run: npm install

# Step 4: Build the app
- name: Build the app
run: npm run build

# Step 5: Authenticate with GCP
- name: Setup gcloud
uses: google-github-actions/setup-gcloud@v2
with:
project_id: notely-489123
service_account_key: ${{ secrets.GCP_CREDENTIALS }}
export_default_credentials: true

# Step 6: Build and push Docker image to Artifact Registry
- name: Build and push Docker image
run: |
gcloud builds submit \
--tag us-central1-docker.pkg.dev/notely-489123/notely-ar-repo/notely:latest .
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 with coverage
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: Run lint
run: npm run lint -- --max-warnings=0
25 changes: 25 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
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
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ RUN npm ci
RUN npm run build

CMD ["node", "dist/main.js"]

6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# learn-cicd-typescript-starter (Notely)

![Tests](https://github.com/a7mad1112/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).

## Local Development
Expand All @@ -22,3 +25,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!

Ahmed Alawneh's version of Boot.dev's Notely app.

19 changes: 19 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
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"],
},
{
files: ["**/*.{js,mjs,cjs,ts,mts,cts}"],
languageOptions: { globals: globals.node },
},
tseslint.configs.recommended,
pluginSecurity.configs.recommended,
]);
Loading