Skip to content

Commit

Permalink
repo: improve deploy documentation in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Favo02 committed Apr 21, 2024
1 parent 75b966d commit 7a2856e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SIHL_ENV=production
SIHL_SECRET=<secret>
DATABASE_URL=postgresql://<username>:<password>@<host>:<port>/<database>
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,23 @@ TL;DR: **Docker** 🐳 + **GitHub Actions** 🤖 for backend and **Cloudflare Pa
- each time a commit is pushed to the `main` branch, `deploy-backend` GitHub action is triggered
- the action connects via ssh to the server, pulls the changes and rebuilds the Docker container
- the backend is available at [https://cessadvisorapi.favo02.dev](https://cessadvisorapi.favo02.dev)
- instructions:
- add `HOST`, `USERNAME`, `PORT`, `KEY`, `SCRIPT` secrets to GitHub
- add private `KEY` provided in secrets to allowed hosts on server
- clone this repository on the server
- create `.env` file in the root of the repository (see [.env.template](./.env.template) for reference)
- create empty folder `logs` in the root of the repository
- `SCRIPT` secret should cd into the repository and run `git pull` and `docker-compose up -d --build --force-recreate`

- **Frontend**: **Cloudflare Pages** ☁️
- each time a commit is pushed to the `main` branch, the Cloudflare pages integration detects the change
- the integration builds the Sveltekit app with some magic
- the frontend is available at [https://cessadvisor.pages.dev](https://cessadvisor.pages.dev) (and [https://cessadvisor.favo02.dev](https://cessadvisor.favo02.dev))
- instructions:
- create a new Cloudflare Pages project
- follow instructions to connect the project to the GitHub repository
- set `Root directory (advanced)` as `frontend`
- set environment variables (see [frontend/.env.template](frontend/.env.template))

</details>

Expand Down

0 comments on commit 7a2856e

Please sign in to comment.