Skip to content

hossam-magdy/hossammagdy.dev

Repository files navigation

CI workflow, 🐳, 🐳

This is my website. Currently, it doesn't include much of a content, just short description & links. However, I mainly utilize it to experience different technologies. The current tech used:

  • Deno + TypeScript + JSX & React (SSR + Client hydration)
  • Google Cloud Run (with custom domain, docs here and here)
  • CI/CD via Github Actions (with GCP_SA_KEY as the only secret for gcloud)

Development

# Install deno executable: https://deno.land

# [In one terminal] Run the bundler in watch mode (deno bundle … …/app.js)
make bundle

# [In another terminal] Run the server in watch mode (deno run … …/server.tsx)
make start

# open: http://localhost:8080
# change code …

# Run the tests (deno test .)
make test

# To deploy:
# `git push` to master branch
# [OR] make deploy (need local executables: `gcloud`)

Running/testing via docker

# Build local docker image
make docker-build

# Bundle local assets, as the volume is mapped into docker start cmd
make bundle

# Start/run the local docker image
make docker-start

# open: http://localhost:8080

# also: `make docker-test`

Deployment (simulate CI/CD)

# docker build …
make ci-build

# docker run … test
make ci-test

# Deploy the CloudRun docker image
# `gcloud build …` && `gcloud beta run deploy …`
make ci-deploy

Refs

Links

TODOs

  • Find out why CMD+C in docker image doesn't terminate/kill the process/image
  • Docs: Steps of deployment secret key storage
  • Extract headers and meta data from skeleton.html
  • Try deno WebGPU API
  • Use deno coverage … --lcov reports in CI pipeline
  • Update & simplify github actions, separating the build&test from gcloud build&deploy
  • Find a way around getting deno bundle to include the react library, then ensure ReactDOM.hydrate works!
  • Use a decent routing library, like abc or oak
  • Create config.ts file to include assetsPath,… etc
  • Update skeleton.html for decent standard content-skeleton (view-port,…)
  • Investigate why in docker image Compile on every start, even after deno cache in Dockerfile
  • Report/fix issue: Deno.fmt doesn't remove unnecessary parentheses, like in const x = (y); (deno uses dprint for formatting)