Skip to content

Commit

Permalink
Migrate production deployment to self-managed server.
Browse files Browse the repository at this point in the history
Deno Deploy has been erratic for too long, now.
  • Loading branch information
BrunoBernardino committed Aug 16, 2023
1 parent 986a62b commit 60394a2
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Deploy

on:
push:
branches:
- main
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Configure SSH
run: |
mkdir -p ~/.ssh/
echo "$SSH_KEY" | tr -d '\r' > ~/.ssh/server.key
chmod 600 ~/.ssh/server.key
cat >>~/.ssh/config <<END
Host server
HostName $SSH_HOST
User $SSH_USER
IdentityFile ~/.ssh/server.key
StrictHostKeyChecking no
END
cat ~/.ssh/config
env:
SSH_HOST: ${{ secrets.SSH_HOST }}
SSH_USER: ${{ secrets.SSH_USER }}
SSH_KEY: ${{ secrets.SSH_KEY }}

- name: Deploy via SSH
run: ssh server 'cd apps/budgetzen-web && git add . && git stash && git pull origin main && git stash clear && git remote prune origin && cp ../../scripts/config/budgetzen-web/.env . && cp ../../scripts/config/budgetzen-web/docker-compose.yml . && docker system prune -f && docker-compose up -d --build && docker-compose ps && docker-compose logs'
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![](https://github.com/BrunoBernardino/budgetzen-web/workflows/Run%20Tests/badge.svg)](https://github.com/BrunoBernardino/budgetzen-web/actions?workflow=Run+Tests)

This is the web app for the [Budget Zen app](https://budgetzen.net), built with [Deno](https://deno.land) and deployed to [Deno Deploy](https://deno.com/deploy).
This is the web app for the [Budget Zen app](https://budgetzen.net), built with [Deno](https://deno.land) and deployed using [docker-compose](https://docs.docker.com/compose/).

This is v3, which is [end-to-end encrypted with open Web Standards](https://en.wikipedia.org/wiki/End-to-end_encryption), and works via web on any device (it's a PWA - Progressive Web App).

Expand Down Expand Up @@ -64,7 +64,7 @@ $ make exec-db # runs psql inside the postgres container, useful for running dir

## Deployment

- Deno Deploy: Just push to the `main` branch. Any other branch will create a preview deployment.
- Just push to the `main` branch.

## TODOs:

Expand Down

0 comments on commit 60394a2

Please sign in to comment.