Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
141540e
Updated the README.md file
kenjchan2011-web Jan 20, 2026
ddcbbc4
Added .github/workflows/ci.yml file with exit code 1.
kenjchan2011-web Jan 20, 2026
6a3c476
Update ci.yml with run: node --version
kenjchan2011-web Jan 20, 2026
4ebae46
Update the test case file and ci.yaml
kenjchan2011-web Jan 21, 2026
450feb0
Updated the code coverage command in the test execution line, 'npm ru…
kenjchan2011-web Jan 21, 2026
0b608d0
Updated the ci.yml with installing vitest line.
kenjchan2011-web Jan 21, 2026
62bf6f1
Update ci.yml with Setup node section
kenjchan2011-web Jan 21, 2026
7ece4bf
update README.md file with markdown in ci
kenjchan2011-web Jan 22, 2026
1a00884
Added job style section to run the format check process in parallel
kenjchan2011-web Jan 22, 2026
73ac9c8
Fixed the ci.yml file
kenjchan2011-web Jan 22, 2026
745c9e4
Removed duplicated lines in ci.yml
kenjchan2011-web Jan 22, 2026
b449127
Added push line in on section in ci.yml
kenjchan2011-web Jan 22, 2026
6b9c023
Udpate the ci.yml to execute the eslint with wrong conde in the src/m…
kenjchan2011-web Jan 22, 2026
b649bc3
Updated the ci.yml
kenjchan2011-web Jan 22, 2026
e3947e0
Renamed the linting
kenjchan2011-web Jan 22, 2026
c599298
Renamed the linting
kenjchan2011-web Jan 22, 2026
49ae2a3
Remolved the eslint installation lines
kenjchan2011-web Jan 22, 2026
c043493
Fixed the style error in main.ts
kenjchan2011-web Jan 22, 2026
3307949
Removed unused function from main.ts
kenjchan2011-web Jan 22, 2026
f14fe88
Fixed hte style in main.ts
kenjchan2011-web Jan 22, 2026
339312d
Added '--max-warning=0' in the Check linting section
kenjchan2011-web Jan 23, 2026
b6f4c37
Fixed the security warning in the sec/api/users.ts. Use the crypto.ra…
kenjchan2011-web Jan 23, 2026
2c14e82
Fixed the issue in users.ts by npx prettier --write 'src/main.ts'
kenjchan2011-web Jan 23, 2026
15d15d3
Add cd.yml to build the deploument
kenjchan2011-web Jan 23, 2026
cc14155
setup GCP with github, docker image in main.yml file
kenjchan2011-web Jan 26, 2026
02c82e8
fixed the main.yml
kenjchan2011-web Jan 26, 2026
93a684d
Added the step section in the main.yml
kenjchan2011-web Jan 26, 2026
3479dd5
added name, on, and job key-wrods in the main.yml
kenjchan2011-web Jan 26, 2026
3f0f820
Add npm ci to make sure typescript lib is installed in the main.yml
kenjchan2011-web Jan 26, 2026
191c734
Set the right repository name in the main.yml
kenjchan2011-web Jan 26, 2026
acbc707
Exact project id is set
kenjchan2011-web Jan 26, 2026
a69a32d
specify the exact project id
kenjchan2011-web Jan 26, 2026
b086946
Added gcloud builds submit phrase to push to gcloud
kenjchan2011-web Jan 26, 2026
754b102
Fixed the process
kenjchan2011-web Jan 26, 2026
6128b6a
Updated the cd.yml file to fit in the gcp env
kenjchan2011-web Jan 26, 2026
2229048
updated the cd.yml and the index.html
kenjchan2011-web Jan 26, 2026
8c9a1b7
update Deploy to Cloud Run section in the cd.yml
kenjchan2011-web Jan 26, 2026
4045c1c
udpate cd.yml
kenjchan2011-web Jan 26, 2026
3c03223
update the cd.yml with the database url info
kenjchan2011-web Jan 27, 2026
5d6ce94
Set the deploy name
kenjchan2011-web Jan 27, 2026
17ff050
Added the db:migration process in cd.yml file
kenjchan2011-web Jan 27, 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
56 changes: 56 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
on:
push:
branches: [main]

jobs:
Deploy:
name: Deploy
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 build
run: npm run build

- name: Run database migrations
run: npm run db:migrate
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}


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

# 2. Set up gcloud CLI
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'
with:
project_id: 'notely-485406'

# 3. Build and Push via Cloud Build
- name: 'Build and Push to Artifact Registry'
run: |-
gcloud builds submit \
--tag us-central1-docker.pkg.dev/notely-485406/notely-ar-repo/my-app:${{ github.sha }} .

- name: Deploy to Cloud Run
run: |
gcloud run deploy notely \
--image us-central1-docker.pkg.dev/notely-485406/notely-ar-repo/my-app:${{ github.sha }} \
--region us-central1 \
--allow-unauthenticated \
--project notely-485406 \
--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:
push:
branches: [main]
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: Run formatting check
run: npm run format:check

- name: Check linting
run: npm run lint -- --max-warnings=0
40 changes: 40 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build and Push to Artifact Registry

on:
push:
branches: [ "main" ] # mainブランチにpushされたら実行

jobs:
deploy: # 任意のジョブ名
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: 'actions/checkout@v4'

- name: 'Build the app'
run: |
npm ci
npx tsc --version # デバッグ用にtscのバージョンを表示
npm run build

# Step 1: Authenticate with GCP
- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}' # The secret you just created

# Step 2: Set up the gcloud CLI
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'
with:
project_id: 'notely-485406'

# Step 4: Configure Docker to use gcloud as a credential helper
- name: 'Docker Auth'
run: |-
gcloud auth configure-docker us-central1-docker.pkg.dev

# Step 4: Build and Push the Docker image
- name: Build and push Docker image
run: gcloud builds submit --tag us-central1-docker.pkg.dev/notely-485406/notely-ar-repo/my-app:${{ github.sha }} .
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[![CI Status](https://github.com/kenjchan2011-web/learn-cicd-typescript-starter/actions/workflows/ci.yml/badge.svg)](https://github.com/kenjchan2011-web/learn-cicd-typescript-starter/actions)
# 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 +23,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!

Kenji'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.browser }
},
tseslint.configs.recommended,
pluginSecurity.configs.recommended,
{
ignores: ["dist/**", "coverage/**", "node_modules/**"]
}
]);
Loading