Skip to content

Commit

Permalink
ci: add production release
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-heimbuch committed Oct 3, 2024
1 parent a522db2 commit eebf837
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 6 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Production
on:
release:
types: [created]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Prepare Remote
uses: appleboy/ssh-action@v1.0.3
with:
host: services.podlove.org
username: root
key: ${{ secrets.PRODUCTION_SSH_KEY }}
script: |
mkdir -p app
cd app
[ ! -d ".git" ] && git clone git@github.com:podlove/publisher-services.git .
- name: Deploy to production environment
uses: appleboy/ssh-action@v1.0.3
env:
SHA: ${{ github.sha }}
VITE_BUILD: ${{ github.sha }}
with:
host: services.podlove.org
username: root
key: ${{ secrets.PRODUCTION_SSH_KEY }}
envs: SHA,VITE_BUILD
script: |
cd app
git fetch
git reset --hard $SHA
devbox install
devbox services down
devbox run bootstrap
devbox run build
devbox services up --background
3 changes: 1 addition & 2 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ jobs:
username: root
key: ${{ secrets.STAGING_SSH_KEY }}
script: |
which devbox || curl -fsSL https://get.jetify.com/devbox | bash
mkdir -p app
cd app
git ls-remote git@github.com:podlove/publisher-next.git -q || git clone -–depth=1 git@github.com:podlove/publisher-next.git .
[ ! -d ".git" ] && && git clone -–depth=1 git@github.com:podlove/publisher-next.git .
- name: Deploy to staging environment
uses: appleboy/ssh-action@v1.0.3
Expand Down
2 changes: 1 addition & 1 deletion devbox.d/caddy/Caddyfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
publisher-services.podlove.dev {
publisher-services.podlove.dev, services.podlove.org {
handle /api/* {
reverse_proxy localhost:4005
}
Expand Down
15 changes: 13 additions & 2 deletions devbox.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,24 @@
"mix local.rebar --force",
"mix deps.get"
],
"bootstrap": ["devbox run bootstrap:client", "devbox run bootstrap:server", "devbox run e2e:bootstrap"],
"bootstrap": [
"devbox run bootstrap:client",
"devbox run bootstrap:server",
"devbox run e2e:bootstrap"
],
"test": ["devbox run test:server"],
"test:server": ["cd server", "mix test"],
"server": ["cd server", "mix run --no-halt"],
"client": ["cd client", "pnpm run dev"],
"build:server": [
"cd server",
"mix local.hex --force",
"mix local.rebar --force",
"mix deps.get --only prod",
"MIX_ENV=prod mix release"
],
"build:client": ["cd client", "pnpm build"],
"build": ["devbox run build:client"],
"build": ["devbox run build:server", "devbox run build:client"],
"e2e:bootstrap": ["cd e2e", "pnpm install"],
"e2e": ["cd e2e", "pnpm run dev"],
"e2e:environment": ["docker compose --file e2e/docker-compose.yml up"]
Expand Down
2 changes: 1 addition & 1 deletion process-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "0.5"

processes:
server:
command: mix run --no-halt
command: server/_build/prod/rel/publisher/bin/publisher start
working_dir: server
environment:
- "PORT=4005"
Expand Down

0 comments on commit eebf837

Please sign in to comment.