diff --git a/lib/nimble_template/variants/phoenix/template.ex b/lib/nimble_template/variants/phoenix/template.ex index 7491d03c1..edf8d0f24 100644 --- a/lib/nimble_template/variants/phoenix/template.ex +++ b/lib/nimble_template/variants/phoenix/template.ex @@ -52,6 +52,7 @@ defmodule NimbleTemplate.Phoenix.Template do do: Addons.Github.apply(project, %{github_action_test: true}) generate_github_action_deploy_heroku? = generate_github_action_deploy_heroku?() + generate_github_action_deploy_aws_ecs? = generate_github_action_deploy_heroku?() if generate_github_action_deploy_heroku?, do: Addons.Github.apply(project, %{github_action_deploy_heroku: true}) @@ -61,16 +62,17 @@ defmodule NimbleTemplate.Phoenix.Template do Addons.Github.apply(project, %{ github_workflows_readme: true, with_test_workflow?: generate_github_action_test?, - with_deploy_to_heroku_workflow?: generate_github_action_deploy_heroku? - }) + with_deploy_to_heroku_workflow?: generate_github_action_deploy_heroku?, + with_deploy_to_aws_ecs_workflow?: generate_github_action_deploy_aws_ecs? + }) if generate_github_wiki?(), do: Addons.Github.apply(project, %{github_wiki: true}) - if generate_github_action_deploy_heroku?(), + if generate_github_action_deploy_heroku?, do: Addons.Github.apply(project, %{github_action_deploy_heroku: true}) - if generate_github_action_deploy_aws_ecs?(), + if generate_github_action_deploy_aws_ecs?, do: Addons.Github.apply(project, %{github_action_deploy_aws_ecs: true}) project diff --git a/priv/templates/nimble_template/.github/workflows/README.md.eex b/priv/templates/nimble_template/.github/workflows/README.md.eex index e56675c48..15dc283bd 100644 --- a/priv/templates/nimble_template/.github/workflows/README.md.eex +++ b/priv/templates/nimble_template/.github/workflows/README.md.eex @@ -16,7 +16,7 @@ The following workflows are supported. - 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: +- 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. - **HOST_URL**: if your app name is `acme`, the value of this var is: `acme.herokuapp.com` - **SECRET_KEY_BASE**: use the `mix phx.gen.secret` to get a new secret and set it as the value of this var. @@ -26,7 +26,7 @@ The following workflows are supported. - 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 -- Making some configuration changes to make the app ready for Heroku (read more in the [official documentation](https://hexdocs.pm/phoenix/heroku.html#making-our-project-ready-for-heroku)) that: +- Making some configuration changes to make the app ready for Heroku (read more in the [official documentation](https://hexdocs.pm/phoenix/heroku.html#making-our-project-ready-for-heroku)) that: tell Phoenix to use Heroku URL and enforce the SSL usage. Also, bind to the port requested by Heroku in the `$PORT` environment variable. Find the `url` configuration in your `config/prod.exs`: @@ -42,13 +42,13 @@ The following workflows are supported. url: [scheme: "https", host: System.get_env("HOST_URL"), port: 443], force_ssl: [rewrite_on: [:x_forwarded_proto]], ``` - + Enable SSL for production environment by uncomment it in the file `config/prod.secret.exs`: ```elixir config :gscraper_web, GscraperWeb.Repo, ssl: true, - ... + ... ``` If you plan on using WebSockets, the timeout for the WebSocket transport needs to be decreased in `lib/hello_web/endpoint.ex`. @@ -57,8 +57,19 @@ The following workflows are supported. socket "/socket", HelloWeb.UserSocket, websocket: [timeout: 45_000], longpoll: false - ... + ... ``` otherwise, leaving it set to `false` as default. <% end %> + + +<%= if with_deploy_to_aws_ecs_workflow? do %> +- [Deploy to AWS ECS](#deploy-to-aws-ecs-workflow-usage-instruction) +<% end %> + +<%= if with_deploy_to_aws_ecs_workflow? do %> +## Deploy to AWS ECS usage instruction + +### Requirements +<% end %>