Skip to content

Commit

Permalink
Make config/deploy.yml available for GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
vladyio committed Dec 7, 2024
1 parent 3efab20 commit 4bd496f
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
HOST_IP=1.1.1.1
KAMAL_PROXY_HOST=example.app,www.example.app
KAMAL_REGISTRY_PASSWORD=
KAMAL_REGISTRY_USERNAME=
RAILS_MASTER_KEY=
SSH_USER=root
SSH_PORT=22
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
# Ignore bundler config.
/.bundle

# Ignore all environment files (except templates).
# Ignore all environment files
/.env*
!/.env.sample
!/.env*.erb
config/deploy.yml
config/deploy.*.yml

# Ignore all logfiles and tempfiles.
Expand Down
63 changes: 63 additions & 0 deletions config/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<% require "dotenv"; Dotenv.load(".env") %>

service: quicktube

image: vladyio/quicktube

servers:
web:
hosts:
- <%= ENV.fetch("HOST_IP") %>
job:
hosts:
- <%= ENV.fetch("HOST_IP") %>
cmd: bundle exec sidekiq
cron:
hosts:
- <%= ENV.fetch("HOST_IP") %>
cmd: bash -c "cat config/crontab | crontab - && declare -p | grep -Ev '\b(BASHOPTS|BASH_VERSINFO|EUID|PPID|SHELLOPTS|UID)\b' >> /rails/tmp/.cron.env && cron -f"

builder:
arch: amd64
cache:
type: registry
options: mode=max,image-manifest=true,oci-mediatypes=true

proxy:
ssl: true
host: <%= ENV.fetch("KAMAL_PROXY_HOST") %>
app_port: 3000

volumes:
- "/rails/public/dl:/rails/public/dl"

asset_path: /rails/public/assets

registry:
server: ghcr.io
username:
- KAMAL_REGISTRY_USERNAME
password:
- KAMAL_REGISTRY_PASSWORD

env:
clear:
REDIS_URL: redis://quicktube-redis:6379/0
MAX_FILESIZE: 1G
RETRIES: 5
PATHS: public/dl
secret:
- RAILS_MASTER_KEY

ssh:
user: <%= ENV.fetch("SSH_USER", "root") %>
port: <%= ENV.fetch("SSH_PORT", 22) %>

accessories:
redis:
roles:
- web
- job
image: redis:7.2.5-alpine
directories:
- data:/data

0 comments on commit 4bd496f

Please sign in to comment.