-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from softwarecrafts/main
Dokku setup for deployment and hosting
- Loading branch information
Showing
8 changed files
with
561 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
heroku/nodejs | ||
heroku/python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--- | ||
name: 'deploy' | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
# container: ubuntu:latest | ||
steps: | ||
- name: Cloning repo | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
# - name: install curl dependency | ||
# run: apt-get update && apt-get install curl sudo bind9-host 2ping -y | ||
# - name: Tailscale | ||
# uses: tailscale/github-action@v2 | ||
# with: | ||
# oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} | ||
# oauth-secret: ${{ secrets.TS_OAUTH_SECRET }} | ||
# tags: tag:ci | ||
# tailscaled-args: --tun=userspace-networking --socks5-server=localhost:1055 --outbound-http-proxy-listen=localhost:1055 | ||
# - name: Test Connectivity | ||
# run: | | ||
# tailscale status | ||
# ls -al /github/home/ | ||
# pwd | ||
# # host aws-dokku | ||
# # ping -c 10 aws-dokku | ||
- name: AWS Security Group Add IP | ||
uses: sohelamin/[email protected] | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_ACCESS_SECRET_KEY }} | ||
aws-region: 'eu-west-2' | ||
aws-security-group-id: 'sg-0e2a639b321457151' | ||
- name: Push to dokku | ||
uses: dokku/github-action@master | ||
with: | ||
git_remote_url: 'ssh://[email protected]:22/django-social' | ||
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
branch: 'main' | ||
git_push_flags: '--force -vvv' | ||
ssh_host_key: ${{ secrets.SSH_HOST_KEY }} | ||
trace: '1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
web: gunicorn djangosocial.wsgi:application --bind 0.0.0.0:$PORT --timeout 300 --chdir django | ||
release: python django/manage.py migrate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,26 @@ | ||
import os | ||
from .base import * | ||
|
||
import dj_database_url | ||
|
||
|
||
try: | ||
from .local import * | ||
except ImportError: | ||
pass | ||
|
||
STATIC_ROOT = BASE_DIR / ".." / "static" | ||
MIDDLEWARE += [ | ||
"whitenoise.middleware.WhiteNoiseMiddleware", | ||
] | ||
|
||
|
||
ALLOWED_HOSTS = os.environ.get("ALLOWED_HOSTS").split(",") | ||
|
||
|
||
DATABASES = { | ||
"default": dj_database_url.config( | ||
conn_max_age=600, | ||
conn_health_checks=True, | ||
), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"name": "djangosocialtw", | ||
"version": "1.0.0", | ||
"description": "Tailwind config for Django.social", | ||
"main": "main.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/djangosocialteam/djangosocial.git" | ||
}, | ||
"author": "Django.social Team", | ||
"license": "BSD-3-Clause", | ||
"bugs": { | ||
"url": "https://github.com/djangosocialteam/djangosocial/issues" | ||
}, | ||
"homepage": "https://github.com/djangosocialteam/djangosocial#readme", | ||
"devDependencies": { | ||
"prettier": "^3.0.3", | ||
"prettier-plugin-tailwindcss": "^0.5.6", | ||
"tailwindcss": "^3.3.3" | ||
}, | ||
"dependencies": { | ||
"@tailwindcss/forms": "^0.5.6" | ||
} | ||
} |
Oops, something went wrong.