Skip to content

Latest commit

 

History

History
55 lines (39 loc) · 1.82 KB

README.md

File metadata and controls

55 lines (39 loc) · 1.82 KB

Code that powers my website, robsoko.com

Local dev

Assuming reasonably up-to-date node and npm, you should be good to run the dev server on your local machine without Docker.

Install elm prerequisites:

npm install -g elm elm-test elm-review elm-spa

Clone this repo, and cd into it. Then generate types used by elm-spa Pages code:

elm-spa gen

Run local dev server:

elm-spa server

elm-spa owns client-side routing, and build steps for deployment. Refer to elm-spa's guide for more information.

I usually open another console to run elm-test:

elm-test --watch

Local nginx debugging

To mimic the build process used by the deployment script do the following:

./scripts/build-local.sh

To run the nginx server:

docker-compose up site

You should be able to view the site in your browser at localhost (implicit port 80). If something is off you can run a sh shell (not bash, alpine is tiny!) by docker exec-ing into the running container

This is also useful to test UIs on mobile. I wasn't able to get elm-spa server to serve on my local network, but building the above dev image works. Note this requires allowing inbound traffic (on local-network!) on port 80.

Deployment

This app runs on GCP CloudRun, which is deployed to via CloudBuild triggers. All CloudBuild related code is located in .cloudbuild/. In order to keep CloudRun wakeup time quick, an nginx alpine image is used to serve the compiled code. This isn't necessary for the current deployment, but I am anticipating need for more complex deployments soon.

Triggers:

  • pr-build: triggered on all PRs issued in this repo
  • deploy-to-cloud-run: triggered on all cut tags for this repo