From 3885eb5bca8bac4909f65dca003f3fb72731aad1 Mon Sep 17 00:00:00 2001 From: Anton Bachin Date: Sat, 8 May 2021 09:37:05 +0300 Subject: [PATCH] Tweak deployment examples --- .github/workflows/heroku.yml | 11 +++++------ example/z-docker-esy/.dockerignore | 6 +++--- example/z-docker-esy/README.md | 4 +++- example/z-docker-opam/.dockerignore | 2 +- example/z-docker-opam/README.md | 2 +- example/z-heroku/README.md | 13 +++++++++++-- example/z-heroku/app.ml | 2 +- example/z-systemd/README.md | 6 ++++-- 8 files changed, 29 insertions(+), 17 deletions(-) diff --git a/.github/workflows/heroku.yml b/.github/workflows/heroku.yml index ebb2ad96..798ce443 100644 --- a/.github/workflows/heroku.yml +++ b/.github/workflows/heroku.yml @@ -1,16 +1,15 @@ name: heroku on: push: - paths: 'example/z-heroku/**' + paths: + - 'example/z-heroku/**' + - .github/workflows/heroku.yml # Set this key on GitHub in your repository's Settings, tab Secrets. The key is -# obtained by running -# -# heroku authorizations:create -# -# locally, after doing +# obtained by running locally # # heroku login -i +# heroku authorizations:create env: HEROKU_API_KEY: ${{secrets.HEROKU_API_KEY}} diff --git a/example/z-docker-esy/.dockerignore b/example/z-docker-esy/.dockerignore index 158af05c..ee7ba21f 100644 --- a/example/z-docker-esy/.dockerignore +++ b/example/z-docker-esy/.dockerignore @@ -1,10 +1,10 @@ -# Esy build environment +# esy build environment _esy/ -# Esy dependencies +# esy dependencies node_modules/ -# Git +# git .git/ .gitignore diff --git a/example/z-docker-esy/README.md b/example/z-docker-esy/README.md index 150624f6..2cb3d254 100644 --- a/example/z-docker-esy/README.md +++ b/example/z-docker-esy/README.md @@ -176,6 +176,8 @@ version of the deploy script. **See also:** +- [**`z-docker-opam`**](../z-docker-opam#files) is a variant of this example + that uses opam instead of esy. - [**`z-systemd`**](../z-systemd#files) packages the app as a systemd daemon, outside of a Docker container. - [**`z-heroku`**](../z-heroku#files) deploys the app to @@ -183,4 +185,4 @@ version of the deploy script.
-[Return to the example index](../#deploying) +[Up to the example index](../#deploying) diff --git a/example/z-docker-opam/.dockerignore b/example/z-docker-opam/.dockerignore index a9c908fa..73a60a97 100644 --- a/example/z-docker-opam/.dockerignore +++ b/example/z-docker-opam/.dockerignore @@ -1,4 +1,4 @@ -# Opam local switch +# opam local switch _opam/ # Dune build environment diff --git a/example/z-docker-opam/README.md b/example/z-docker-opam/README.md index 6f2ff502..7912702e 100644 --- a/example/z-docker-opam/README.md +++ b/example/z-docker-opam/README.md @@ -20,4 +20,4 @@ there automatically, on push, by a
-[Return to the example index](../#deploying) +[Up to the example index](../#deploying) diff --git a/example/z-heroku/README.md b/example/z-heroku/README.md index 322c5321..c0fac77f 100644 --- a/example/z-heroku/README.md +++ b/example/z-heroku/README.md @@ -19,7 +19,7 @@ let () = Dream.run ~interface:"0.0.0.0" ~port:(int_of_string (Sys.getenv "PORT")) @@ Dream.logger @@ Dream.router [ - Dream.get "/" (fun _ -> Dream.html "Good morning, world!"); + Dream.get "/" (fun _ -> Dream.html "Dream running in Heroku!"); ] @@ Dream.not_found ``` @@ -179,4 +179,13 @@ by Aleksandra Sikora.
-[Return to the example index](../#deploying) +**See also:** + +- [**`z-docker-esy`**](../z-docker-esy#files) deploys to a dedicated server, + with the Web application managed by Docker Compose. +- [**`z-systemd`**](../z-systemd#files) deploys to a dedicated server, running + the Web application as a systemd daemon. + +
+ +[Up to the example index](../#deploying) diff --git a/example/z-heroku/app.ml b/example/z-heroku/app.ml index bc1570d6..c2c86bdb 100644 --- a/example/z-heroku/app.ml +++ b/example/z-heroku/app.ml @@ -2,6 +2,6 @@ let () = Dream.run ~interface:"0.0.0.0" ~port:(int_of_string (Sys.getenv "PORT")) @@ Dream.logger @@ Dream.router [ - Dream.get "/" (fun _ -> Dream.html "Good morning, world!"); + Dream.get "/" (fun _ -> Dream.html "Dream running in Heroku!"); ] @@ Dream.not_found diff --git a/example/z-systemd/README.md b/example/z-systemd/README.md index f8ba82c9..73f023dc 100644 --- a/example/z-systemd/README.md +++ b/example/z-systemd/README.md @@ -37,7 +37,9 @@ let () = @@ Dream.not_found ``` -It is live at [http://systemd.dream.as](http://systemd.dream.as). +It is live at [http://systemd.dream.as](http://systemd.dream.as). As a second +example, the [playground](http://dream.as) is deployed as a [systemd +service](https://github.com/aantron/dream/blob/master/example/z-playground/server/playground.service). The service can be hosted on any server provider. We will use [Digital Ocean](https://www.digitalocean.com) in this example. We will run the build @@ -199,4 +201,4 @@ very convenient way of passing it to the action.
-[Return to the example index](../#deploying) +[Up to the example index](../#deploying)