Compare commits

..

24 Commits

Author SHA1 Message Date
shaamilahmed 6ad77f7ef6 fix: enforce lowercase repository name for Docker tags
Production Deployment / Build and Push Docker Image (push) Successful in 30s
Production Deployment / Deploy to DigitalOcean Droplet (push) Successful in 18s
Production Deployment / Deploy to Google Cloud Run (push) Has been skipped
2026-05-31 08:24:31 +05:00
shaamilahmed 3c46cb7c5b fix: use secrets.REGISTRY_TOKEN for Gitea registry authentication
Production Deployment / Build and Push Docker Image (push) Failing after 17s
Production Deployment / Deploy to DigitalOcean Droplet (push) Has been skipped
Production Deployment / Deploy to Google Cloud Run (push) Has been skipped
2026-05-31 08:23:47 +05:00
shaamilahmed 6c5c85ec4c boop 2026-05-31 07:51:53 +05:00
shaamilahmed d7de80e7e0 feat: configure gitea Actions deployment workflow and update droplet deployment documentation
Production Deployment / Build and Push Docker Image (push) Failing after 16s
Production Deployment / Deploy to DigitalOcean Droplet (push) Has been skipped
Production Deployment / Deploy to Google Cloud Run (push) Has been skipped
2026-05-31 07:15:57 +05:00
shaamilahmed 9d88936b4a feat: add Gitea deployment workflow for SG region and document Droplet deployment
Production Deployment / Build and Push Docker Image (push) Failing after 17s
Production Deployment / Deploy to DigitalOcean Droplet (push) Has been skipped
Production Deployment / Deploy to Google Cloud Run (push) Has been skipped
2026-05-31 07:00:13 +05:00
shaamilahmed 83fbb16b6b Merge branch 'main' of https://git.nciphered.com/shaamilahmed/htmx into refactored (complete rewrite) 2026-05-31 06:42:52 +05:00
shaamilahmed 0787525134 Added issues that are going to be tracked and will be deeply considering changes based on DX.
Co-authored-by: Copilot <copilot@github.com>
2026-05-06 00:21:13 +05:00
shaamilahmed f6ae86617c Rewrote all the docs - more noob friendly now.
Co-authored-by: Copilot <copilot@github.com>
2026-05-05 23:55:26 +05:00
shaamilahmed e483bf73e7 Stess testing added, it wasn't very helpful cause the server could easily handle 100 chrome instances at the same time. May be would be better to stress test with pure http requests instead. Leaving this for later.
Co-authored-by: Copilot <copilot@github.com>
2026-05-05 23:13:12 +05:00
shaamilahmed b12767e0fa Updated script dir update 2026-05-05 21:51:28 +05:00
shaamilahmed 588e18bbd2 Update script location definition 2026-05-05 21:51:06 +05:00
shaamilahmed aede9a796e Updated home page 2026-05-05 20:38:02 +05:00
shaamilahmed 22577fe3fb Removed Immediate.Apis, Added AOT Testing Scripts. 2026-05-05 18:47:11 +05:00
shaamilahmed ec7ab8aadc Fixed the css issue. 2026-05-05 15:12:05 +05:00
shaamilahmed bd6d8d78fc GCR deployment testing in progress - css issue remaining 2026-05-05 14:57:01 +05:00
shaamilahmed f8112f897e GCR deployment testing in progress - content type issue still remaining. 2026-05-05 14:42:03 +05:00
shaamilahmed 40fe69ed65 Intial commit for deployment script p2 2026-05-04 23:23:02 +05:00
shaamilahmed 724e6a8ecd Initial commit for deployment scripts - not tested yet. 2026-05-04 23:22:39 +05:00
shaamilahmed ee8797c142 Documentations added
Co-authored-by: Copilot <copilot@github.com>
2026-05-04 19:57:48 +05:00
shaamilahmed 40a7d9018c Created more components 2026-05-04 18:58:48 +05:00
shaamilahmed fb1cb8e834 Added components, authentication and authorization 2026-05-04 16:53:19 +05:00
shaamilahmed 493cd71d17 Made the Greeting class sealed as it's not suppose to be inherited from 2026-05-03 23:53:33 +05:00
shaamilahmed 277a65c6c7 Removed Unnecessary usings and comments 2026-05-03 23:46:03 +05:00
shaamilahmed 7778a94cf5 Init 2026-05-03 23:35:42 +05:00
2 changed files with 144 additions and 0 deletions
+112
View File
@@ -0,0 +1,112 @@
name: Production Deployment
on:
push:
branches:
- main
- refactored
jobs:
build:
name: Build and Push Docker Image
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Gitea Container Registry
uses: docker/login-action@v3
with:
registry: git.nciphered.com
username: ${{ github.actor }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build and Push Image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
git.nciphered.com/shaamilahmed/htmx:latest
git.nciphered.com/shaamilahmed/htmx:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
deploy-droplet:
name: Deploy to DigitalOcean Droplet
needs: build
runs-on: ubuntu-latest
if: ${{ secrets.DEPLOY_TARGET == 'droplet' }}
steps:
- name: Executing remote SSH commands to deploy
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.DROPLET_HOST }}
username: ${{ secrets.DROPLET_USER }}
key: ${{ secrets.DROPLET_SSH_KEY }}
script: |
# Authenticate with Gitea registry on Droplet
docker login -u "${{ github.actor }}" -p "${{ secrets.REGISTRY_TOKEN }}" git.nciphered.com
# Pull latest image
docker pull git.nciphered.com/shaamilahmed/htmx:latest
# Stop existing container
docker rm -f ${{ secrets.APP_CONTAINER_NAME }} || true
# Run container with user-defined docker flags (e.g., --network, -p)
docker run -d \
--name ${{ secrets.APP_CONTAINER_NAME }} \
${{ secrets.DOCKER_RUN_FLAGS }} \
-e DATABASE_URL="${{ secrets.DATABASE_URL_DROPLET }}" \
-e DATABASE_NAME="${{ secrets.DATABASE_NAME }}" \
-e JWT_SECRET="${{ secrets.JWT_SECRET }}" \
-e HOST="0.0.0.0" \
-e PORT="${{ secrets.APP_PORT }}" \
--restart unless-stopped \
git.nciphered.com/shaamilahmed/htmx:latest
deploy-cloudrun:
name: Deploy to Google Cloud Run
needs: build
runs-on: ubuntu-latest
if: ${{ secrets.DEPLOY_TARGET == 'cloudrun' }}
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Authenticate with Google Cloud
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
- name: Configure Docker Authentication
run: |
gcloud auth configure-docker asia-southeast1-docker.pkg.dev --quiet
- name: Tag and Push Image to Artifact Registry
run: |
# Build/Tag for Google Artifact Registry
docker tag git.nciphered.com/shaamilahmed/htmx:latest asia-southeast1-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/stick/app:latest
docker push asia-southeast1-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/stick/app:latest
- name: Deploy to Google Cloud Run
uses: google-github-actions/deploy-cloudrun@v2
with:
service: stick-app
image: asia-southeast1-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/stick/app:latest
region: asia-southeast1
env_vars: |
DATABASE_URL=${{ secrets.DATABASE_URL_CLOUDRUN }}
DATABASE_NAME=${{ secrets.DATABASE_NAME }}
JWT_SECRET=${{ secrets.JWT_SECRET }}
HOST=0.0.0.0
PORT=3007
+32
View File
@@ -200,3 +200,35 @@ pub async fn delete_task_handler(
Ok(Redirect::to("/tasks"))
}
```
---
## Production Deployment to a Cloud Host (DigitalOcean Droplet)
For production deployments (such as to a DigitalOcean Droplet), the application is fully containerized and configured via standard environment variables.
The application is completely decoupled from the underlying hosting, networking, and database infrastructure. You are responsible for provisioning the database and supplying the connection configuration.
### 1. Build the Application Container
Build the application Docker image:
```bash
docker build -t stick-app .
```
### 2. Deploy the Application Container
Run the container on your target Docker network, providing the connection details to your pre-existing MongoDB database container through environment variables:
```bash
docker run -d \
--name stick-app \
--network your-docker-network \
-p 80:3007 \
-e DATABASE_URL="mongodb://your-mongodb-host:27017" \
-e DATABASE_NAME="stick_db" \
-e JWT_SECRET="your_secure_production_jwt_signing_key_at_least_32_chars_long" \
-e HOST="0.0.0.0" \
-e PORT="3007" \
--restart unless-stopped \
stick-app
```
*Note: Adjust the port mapping (`-p`), container name, network name, and `DATABASE_URL` environment variable as necessary to integrate with your custom proxy or container infrastructure.*