Skip to content

Commit

Permalink
Merge pull request #900 from hngprojects/ci-workflow
Browse files Browse the repository at this point in the history
Ci-workflow
  • Loading branch information
laraadeboye authored Aug 15, 2024
2 parents f219ec6 + 1b5caa2 commit 4266152
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 12 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/cd.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: [dev]
paths-ignore:
- "README.md"
- ".github/workflows/**"
# - ".github/workflows/**"
workflow_dispatch:

jobs:
Expand All @@ -23,10 +23,10 @@ jobs:
password: ${{ secrets.PASSWORD }}
script: |
cd hng_boilerplate_python_fastapi_web
# git add .
# git stash
# git checkout dev
# git pull origin dev
git add .
git stash
git checkout dev
git pull origin dev
source venv-dev/bin/activate
pip install -r requirements.txt
alembic upgrade head
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/cd.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: [main]
paths-ignore:
- "README.md"
- ".github/workflows/**"
# - ".github/workflows/**"
workflow_dispatch:

jobs:
Expand All @@ -22,9 +22,14 @@ jobs:
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script: |
cd boilerplate-python/prod/
cd hng_boilerplate_python_fastapi_web
git add .
git stash
git checkout main
git pull origin main
source .venv/bin/activate
source venv-prod/bin/activate
pip install -r requirements.txt
alembic upgrade head
echo "${{ secrets.PASSWORD }}" | sudo -S systemctl restart python-bp-prod.service
11 changes: 8 additions & 3 deletions .github/workflows/cd.staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: [staging]
paths-ignore:
- "README.md"
- ".github/workflows/**"
# - ".github/workflows/**"
workflow_dispatch:

jobs:
Expand All @@ -23,8 +23,13 @@ jobs:
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script: |
cd boilerplate-python/staging/
cd hng_boilerplate_python_fastapi_web
git add .
git stash
git checkout staging
git pull origin staging
source .venv/bin/activate
source venv-staging/bin/activate
pip install -r requirements.txt
alembic upgrade head
echo "${{ secrets.PASSWORD }}" | sudo -S systemctl restart python-bp-staging.service
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types: [opened, synchronize, reopened]
paths-ignore:
- "README.md"
- ".github/workflows/**"
# - ".github/workflows/**"

jobs:
build-and-test:
Expand Down

0 comments on commit 4266152

Please sign in to comment.