Current section

Files

Jump to
nimble_template priv templates nimble_template .github workflows README.md.eex
Raw

priv/templates/nimble_template/.github/workflows/README.md.eex

# Github Actions
The following workflows are supported.
<%= if with_test_workflow? do %>
- Test
<% end %>
<%= if with_deploy_to_heroku_workflow? do %>
- [Deploy to Heroku](#deploy-to-heroku-workflow-usage-instruction)
<% end %>
<%= if with_deploy_to_heroku_workflow? do %>
## Deploy to Heroku Workflow usage instruction
### Requirements
- A pre-generated [Heroku App](https://devcenter.heroku.com/articles/creating-apps)
- A Heroku API key. It can be generated under your [Account Settings](https://dashboard.heroku.com/account#api-key)
- Three Heroku config vars:
- **DATABASE_URL**: It will be created automatically when the [PostgreSQL add-on](https://elements.heroku.com/addons/heroku-postgresql) is added.
- **PHX_HOST**: if your app name is `acme`, the value of this var is: `acme.herokuapp.com`
- **HEALTH_PATH**: Health path (eg: "/_health")
- **SECRET_KEY_BASE**: use the `mix phx.gen.secret` to get a new secret and set it as the value of this var.
### How to use
- Defining two [Github secrets](https://docs.github.com/en/actions/reference/encrypted-secrets) to hold the value of Heroku API key and Heroku app name:
- HEROKU_API_KEY
- HEROKU_APP_NAME
- If you plan on using WebSockets, the timeout for the WebSocket transport needs to be decreased in `lib/hello_web/endpoint.ex`.
```elixir
socket "/socket", HelloWeb.UserSocket,
websocket: [timeout: 45_000],
longpoll: false
...
```
otherwise, leaving it set to `false` as default.
<% end %>