Compare commits
3 Commits
d7de80e7e0
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 6ad77f7ef6 | |||
| 3c46cb7c5b | |||
| 6c5c85ec4c |
@@ -22,7 +22,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
registry: git.nciphered.com
|
registry: git.nciphered.com
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
|
||||||
- name: Build and Push Image
|
- name: Build and Push Image
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
@@ -30,8 +30,8 @@ jobs:
|
|||||||
context: .
|
context: .
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
git.nciphered.com/${{ github.repository }}:latest
|
git.nciphered.com/shaamilahmed/htmx:latest
|
||||||
git.nciphered.com/${{ github.repository }}:${{ github.sha }}
|
git.nciphered.com/shaamilahmed/htmx:${{ github.sha }}
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
|
|
||||||
@@ -49,10 +49,10 @@ jobs:
|
|||||||
key: ${{ secrets.DROPLET_SSH_KEY }}
|
key: ${{ secrets.DROPLET_SSH_KEY }}
|
||||||
script: |
|
script: |
|
||||||
# Authenticate with Gitea registry on Droplet
|
# Authenticate with Gitea registry on Droplet
|
||||||
docker login -u "${{ github.actor }}" -p "${{ secrets.GITHUB_TOKEN }}" git.nciphered.com
|
docker login -u "${{ github.actor }}" -p "${{ secrets.REGISTRY_TOKEN }}" git.nciphered.com
|
||||||
|
|
||||||
# Pull latest image
|
# Pull latest image
|
||||||
docker pull git.nciphered.com/${{ github.repository }}:latest
|
docker pull git.nciphered.com/shaamilahmed/htmx:latest
|
||||||
|
|
||||||
# Stop existing container
|
# Stop existing container
|
||||||
docker rm -f ${{ secrets.APP_CONTAINER_NAME }} || true
|
docker rm -f ${{ secrets.APP_CONTAINER_NAME }} || true
|
||||||
@@ -67,7 +67,7 @@ jobs:
|
|||||||
-e HOST="0.0.0.0" \
|
-e HOST="0.0.0.0" \
|
||||||
-e PORT="${{ secrets.APP_PORT }}" \
|
-e PORT="${{ secrets.APP_PORT }}" \
|
||||||
--restart unless-stopped \
|
--restart unless-stopped \
|
||||||
git.nciphered.com/${{ github.repository }}:latest
|
git.nciphered.com/shaamilahmed/htmx:latest
|
||||||
|
|
||||||
|
|
||||||
deploy-cloudrun:
|
deploy-cloudrun:
|
||||||
@@ -94,7 +94,7 @@ jobs:
|
|||||||
- name: Tag and Push Image to Artifact Registry
|
- name: Tag and Push Image to Artifact Registry
|
||||||
run: |
|
run: |
|
||||||
# Build/Tag for Google Artifact Registry
|
# Build/Tag for Google Artifact Registry
|
||||||
docker tag git.nciphered.com/${{ github.repository }}:latest asia-southeast1-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/stick/app:latest
|
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
|
docker push asia-southeast1-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/stick/app:latest
|
||||||
|
|
||||||
- name: Deploy to Google Cloud Run
|
- name: Deploy to Google Cloud Run
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ docker build -t stick-app .
|
|||||||
Run the container on your target Docker network, providing the connection details to your pre-existing MongoDB database container through environment variables:
|
Run the container on your target Docker network, providing the connection details to your pre-existing MongoDB database container through environment variables:
|
||||||
```bash
|
```bash
|
||||||
docker run -d \
|
docker run -d \
|
||||||
--name stick-app-container \
|
--name stick-app \
|
||||||
--network your-docker-network \
|
--network your-docker-network \
|
||||||
-p 80:3007 \
|
-p 80:3007 \
|
||||||
-e DATABASE_URL="mongodb://your-mongodb-host:27017" \
|
-e DATABASE_URL="mongodb://your-mongodb-host:27017" \
|
||||||
|
|||||||
Reference in New Issue
Block a user