Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .ev
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DATABASE_URL=file:./dev.db
33 changes: 33 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CD
on:
push:
branches: [ main ]
jobs:
Deploy:
runs-on: ubuntu-latest
env:
GCP_PROJECT_ID: intense-optics-472820-m4
ARTIFACT_REGION: europe-west10
ARTIFACT_REPOSITORY: notely-ar-repo
IMAGE_NAME: notely
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build app
run: npm run build
- name: Set up gcloud
uses: google-github-actions/setup-gcloud@v2
with:
project_id: ${{ env.GCP_PROJECT_ID }}
service_account_key: ${{ secrets.GCP_CREDENTIALS }}
- name: Build & push image to Artifact Registry (Cloud Build)
run: |
TAG="${{ github.sha }}"
gcloud builds submit \
--tag "${{ env.ARTIFACT_REGION }}-docker.pkg.dev/${{ env.GCP_PROJECT_ID }}/${{ env.ARTIFACT_REPOSITORY }}/${{ env.IMAGE_NAME }}:${TAG}" .

37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: ci

on:
push:
branches: [main, addtests, style-checks]
pull_request:
branches: [main]

jobs:
tests:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm run test

style:
name: Style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Check formatting
run: npm run format:check

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ coverage/
dist/
.env
.vscode
gcp-sa-key.json
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
![CI](https://github.com/aengus1968/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,4 @@ 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!

21 changes: 21 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import js from "@eslint/js";
import globals from "globals";
import tseslint from "typescript-eslint";

export default [
// Ignore build/coverage folders
{ ignores: ["dist/**", "coverage/**", "node_modules/**"] },

// Recommended configs
js.configs.recommended,
...tseslint.configs.recommended,

// Node environment
{
files: ["**/*.{ts,js,mts,cts,mjs,cjs}"],
languageOptions: {
globals: { ...globals.node },
},
},
];

Loading