Skip to content

Commit eacc027

Browse files
committed
add hetzner deployment
1 parent 5642f5d commit eacc027

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Production
2+
on:
3+
push:
4+
branches: [ main ]
5+
workflow_dispatch:
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Deploy to production environment
12+
uses: appleboy/[email protected]
13+
env:
14+
SHA: ${{ github.sha }}
15+
VITE_BUILD: ${{ github.sha }}
16+
HONEYBADGER_API_KEY: ${{ secrets.HONEYBADGER_KEY }}
17+
with:
18+
host: 157.180.48.235
19+
username: deploy_gh_publisher_services
20+
key: ${{ secrets.PRODUCTION_HETZNER_SSH_KEY }}
21+
envs: SHA,VITE_BUILD,HONEYBADGER_API_KEY
22+
script: |
23+
cd /var/www/publisher-services
24+
git fetch
25+
git reset --hard $SHA
26+
27+
# Bootstrap client
28+
cd client
29+
pnpm install
30+
cd ..
31+
32+
# Build server
33+
cd server
34+
export MIX_HOME=$PWD/.nix-mix
35+
export HEX_HOME=$PWD/.nix-hex
36+
mix local.hex --force
37+
mix local.rebar --force
38+
mix deps.get --only prod
39+
MIX_ENV=prod mix release --overwrite
40+
cd ..
41+
42+
# Build client
43+
cd client
44+
pnpm build
45+
cd ..

0 commit comments

Comments
 (0)