Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update deploy workflow #12

Merged
merged 1 commit into from
Dec 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
push:
branches:
- main
paths:
- "stack/**"

jobs:
deploy:
Expand All @@ -22,13 +24,11 @@ jobs:
name: Setting up Stack
run: |
mkdir -p $PROJECT_PATH
cp -f ./deploy/prod.compose.yml $PROJECT_PATH/docker-compose.yml
echo "$BACKEND_ENV_CONTENT" > $PROJECT_PATH/.backend.env
echo "$MONGO_ENV_CONTENT" > $PROJECT_PATH/.mongo.env
cp -f ./stack/prod.compose.yml $PROJECT_PATH/docker-compose.yml
echo "$ENV_CONTENT" > $PROJECT_PATH/.backend.env
env:
PROJECT_PATH: ${{ secrets.PROJECT_PATH }}
BACKEND_ENV_CONTENT: ${{ secrets.BACKEND_ENV_CONTENT }}
MONGO_ENV_CONTENT: ${{ secrets.MONGO_ENV_CONTENT }}
ENV_CONTENT: ${{ secrets.ENV_CONTENT }}
-
name: Pull changes and restart
run: |
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
__pycache__/
*.pyc
venv/
deploy/data/
stack/data/
*.env
todo.md
19 changes: 0 additions & 19 deletions deploy/dev.compose.yml

This file was deleted.

27 changes: 0 additions & 27 deletions deploy/docker-compose.yml

This file was deleted.

15 changes: 15 additions & 0 deletions stack/.env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# BASE APP CONFIG
APP_HOST="0.0.0.0"
APP_PORT="8080"
# MONGO CONNECTION
MONGO_HOST="your-mongo-host"
MONGO_PORT="27017"
MONGO_USER="your-mongo-user"
MONGO_PASS="your-mongo-pass"
# UPDATE ENDPOINTS
ADMIN_USER="your-admin-user"
ADMIN_PASS="your-admin-pass"
# NGINX PROXY
VIRTUAL_HOST="bcra-scraper-api.your-domain.com"
VIRTUAL_PORT="8080"
LETSENCRYPT_HOST="bcra-scraper-api.your-domain.com"
3 changes: 1 addition & 2 deletions deploy/prod.compose.yml → stack/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ services:
image: alejoide/bcra-scraper-api:latest
restart: unless-stopped
env_file:
- .backend.env
- .env
networks:
- mongo
- nginx-proxy


# Only for production environments when using jwilder/nginx-proxy.
networks:
nginx-proxy:
Expand Down