Skip to content

Commit

Permalink
update docker compose and cicd
Browse files Browse the repository at this point in the history
  • Loading branch information
ytliuSVN committed Nov 2, 2024
1 parent fa3e5f3 commit 2b0e909
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ name: Checks
on: [push]

jobs:
test-lint:
name: Test and Lint
runs-on: ubuntu-20.04
steps:
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v2
- name: Test
run: docker compose run --rm app sh -c "python manage.py test"
- name: Lint
run: docker compose run --rm app sh -c "flake8"
test-lint:
name: Test and Lint
runs-on: ubuntu-20.04
steps:
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v2
- name: Test
run: docker compose run --rm app sh -c "python manage.py wait_for_db && python manage.py test"
- name: Lint
run: docker compose run --rm app sh -c "flake8"
4 changes: 3 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ services:
volumes:
- ./app:/app
command: >
sh -c "python manage.py runserver 0.0.0.0:8000"
sh -c "python manage.py wait_for_db &&
python manage.py migrate &&
python manage.py runserver 0.0.0.0:8000"
environment:
- DB_HOST=db
- DB_NAME=devdb
Expand Down

0 comments on commit 2b0e909

Please sign in to comment.