Skip to content

Commit f1befda

Browse files
committed
move to github registry
1 parent 68b5500 commit f1befda

5 files changed

Lines changed: 55 additions & 29 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ jobs:
128128
129129
- name: Kamal Deploy
130130
env:
131-
DOCKER_REGISTRY_TOKEN: ${{ secrets.DOCKER_REGISTRY_TOKEN }}
131+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
132132
SMTP_USERNAME: ${{ secrets.SMTP_USERNAME }}
133133
SMTP_PASSWORD: ${{ secrets.SMTP_PASSWORD }}
134134
RESEND_API_KEY: ${{ secrets.RESEND_API_KEY }}

.kamal/secrets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
# Use a GITHUB_TOKEN if private repositories are needed for the image
1111
# GITHUB_TOKEN=$(gh config get -h github.com oauth_token)
1212

13-
# Read secrets directly from .env file or ENV variables
14-
DOCKER_REGISTRY_TOKEN=$(grep '^DOCKER_REGISTRY_TOKEN=' .env 2>/dev/null | cut -d'=' -f2)
13+
# GitHub token for container registry access
14+
GITHUB_TOKEN=$(grep '^GITHUB_TOKEN=' .env 2>/dev/null | cut -d'=' -f2 || echo $GITHUB_TOKEN)
1515

1616
# Improve security by using a password manager. Never check config/master.key into git!
1717
RAILS_MASTER_KEY=$(cat config/master.key)

config/deploy.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
service: splitmysub
33

44
# Name of the container image.
5-
image: ashwinmk2016/splitmysub
5+
image: ghcr.io/ashwin47/splitmysub
66

77
# Deploy to these servers.
88
servers:
@@ -23,12 +23,11 @@ proxy:
2323

2424
# Credentials for your image host.
2525
registry:
26-
# Specify the registry server, if you're not using Docker Hub
27-
server: registry.digitalocean.com/super-registry
28-
username:
29-
- DOCKER_REGISTRY_TOKEN
26+
# GitHub Container Registry
27+
server: ghcr.io
28+
username: ashwin47
3029
password:
31-
- DOCKER_REGISTRY_TOKEN
30+
- GITHUB_TOKEN
3231

3332
# Inject ENV variables into containers (secrets come from .kamal/secrets).
3433
env:

docs/DEPLOYMENT.md

Lines changed: 45 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,43 +35,46 @@ proxy:
3535
host: your-domain.com # Replace with actual domain
3636
```
3737
38-
### 2. Set Up Container Registry
38+
### 2. Container Registry Configuration
3939
40-
Choose one of these options:
40+
**GitHub Container Registry (Default - FREE for public repositories)**
41+
42+
The application is pre-configured to use GitHub Container Registry:
4143
42-
#### Option A: Docker Hub
4344
```yaml
4445
registry:
45-
username: your-dockerhub-username
46+
server: ghcr.io
47+
username: ashwin47
4648
password:
47-
- KAMAL_REGISTRY_PASSWORD
49+
- GITHUB_TOKEN
4850
```
4951
50-
#### Option B: GitHub Container Registry
52+
**Alternative Options:**
53+
54+
#### Option A: Docker Hub
5155
```yaml
5256
registry:
53-
server: ghcr.io
54-
username: your-github-username
57+
username: your-dockerhub-username
5558
password:
56-
- KAMAL_REGISTRY_PASSWORD
59+
- DOCKER_HUB_TOKEN
5760
```
5861
59-
#### Option C: DigitalOcean Container Registry
62+
#### Option B: DigitalOcean Container Registry
6063
```yaml
6164
registry:
6265
server: registry.digitalocean.com
6366
username: your-do-username
6467
password:
65-
- KAMAL_REGISTRY_PASSWORD
68+
- DOCKER_REGISTRY_TOKEN
6669
```
6770
6871
### 3. Configure Environment Variables
6972
7073
Set up your environment variables in `.kamal/secrets`. **All secret variables must be configured for production deployment:**
7174

7275
```bash
73-
# Registry password (Docker Hub token, GitHub token, etc.)
74-
export KAMAL_REGISTRY_PASSWORD="your-registry-token"
76+
# GitHub token for container registry (automatic in GitHub Actions)
77+
export GITHUB_TOKEN="your-github-personal-access-token"
7578
7679
# Rails master key (from config/master.key)
7780
export RAILS_MASTER_KEY="$(cat config/master.key)"
@@ -92,12 +95,24 @@ export CLOUDFLARE_TURNSTILE_SITE_KEY="your-turnstile-site-key"
9295
export CLOUDFLARE_TURNSTILE_SECRET_KEY="your-turnstile-secret-key"
9396
```
9497

95-
### 4. Update Image Name
98+
**Note:** When deploying via GitHub Actions, the `GITHUB_TOKEN` is automatically provided - no manual configuration needed!
9699

97-
In `config/deploy.yml`, update the image name:
100+
### 4. Image Name Configuration
101+
102+
The application is pre-configured to use GitHub Container Registry:
98103

99104
```yaml
100-
image: your-registry-username/splitmysub
105+
image: ghcr.io/ashwin47/splitmysub
106+
```
107+
108+
**For alternative registries:**
109+
110+
```yaml
111+
# Docker Hub
112+
image: your-dockerhub-username/splitmysub
113+
114+
# DigitalOcean
115+
image: registry.digitalocean.com/your-registry/splitmysub
101116
```
102117

103118
## Environment Variables Reference
@@ -154,7 +169,19 @@ The following environment variables are configured in the `env.clear` section:
154169

155170
## Deployment Commands
156171

157-
### First-Time Deployment
172+
### GitHub Actions Deployment (Recommended)
173+
174+
The repository is configured with GitHub Actions for automatic deployment:
175+
176+
1. **Push to main branch** triggers automatic deployment
177+
2. **GitHub Container Registry** authentication is handled automatically
178+
3. **No manual deployment commands** needed
179+
180+
### Manual Deployment
181+
182+
For manual deployment from your local machine:
183+
184+
#### First-Time Deployment
158185

159186
1. **Setup the server:**
160187
```bash
@@ -166,7 +193,7 @@ The following environment variables are configured in the `env.clear` section:
166193
bin/kamal deploy
167194
```
168195

169-
### Regular Deployments
196+
#### Regular Deployments
170197

171198
```bash
172199
bin/kamal deploy

docs/SELF_HOSTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The fastest way to get SplitMySub running is with Docker.
2727

2828
```bash
2929
# Clone the repository
30-
git clone https://github.com/yourusername/splitmysub.git
30+
git clone https://github.com/ashwin47/splitmysub.git
3131
cd splitmysub
3232

3333
# Copy environment template
@@ -131,7 +131,7 @@ brew install ruby@3.4 node yarn sqlite3
131131

132132
```bash
133133
# Clone repository
134-
git clone https://github.com/yourusername/splitmysub.git
134+
git clone https://github.com/ashwin47/splitmysub.git
135135
cd splitmysub
136136

137137
# Install Ruby gems

0 commit comments

Comments
 (0)