Skip to content

Commit

Permalink
Tweak deployment examples
Browse files Browse the repository at this point in the history
  • Loading branch information
aantron committed May 8, 2021
1 parent f36afcf commit 3885eb5
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 17 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/heroku.yml
Original file line number Diff line number Diff line change
@@ -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}}

Expand Down
6 changes: 3 additions & 3 deletions example/z-docker-esy/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Esy build environment
# esy build environment
_esy/

# Esy dependencies
# esy dependencies
node_modules/

# Git
# git
.git/
.gitignore

Expand Down
4 changes: 3 additions & 1 deletion example/z-docker-esy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,13 @@ 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
[Heroku](https://heroku.com).

<br>

[Return to the example index](../#deploying)
[Up to the example index](../#deploying)
2 changes: 1 addition & 1 deletion example/z-docker-opam/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Opam local switch
# opam local switch
_opam/

# Dune build environment
Expand Down
2 changes: 1 addition & 1 deletion example/z-docker-opam/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ there automatically, on push, by a

<br>

[Return to the example index](../#deploying)
[Up to the example index](../#deploying)
13 changes: 11 additions & 2 deletions example/z-heroku/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down Expand Up @@ -179,4 +179,13 @@ by Aleksandra Sikora.

<br>

[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.

<br>

[Up to the example index](../#deploying)
2 changes: 1 addition & 1 deletion example/z-heroku/app.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 4 additions & 2 deletions example/z-systemd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -199,4 +201,4 @@ very convenient way of passing it to the action.

<br>

[Return to the example index](../#deploying)
[Up to the example index](../#deploying)

0 comments on commit 3885eb5

Please sign in to comment.