diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 68d89cc9e..ae8cf0a45 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,9 +1,7 @@ name: Deploy to Server on: - pull_request: - # Change to merge when implemented (still beta) - types: [closed] + push: branches: - master @@ -12,22 +10,21 @@ jobs: name: Deploy runs-on: ubuntu-latest steps: - - name: executing remote ssh commands using key - uses: appleboy/ssh-action@v0.1.4 - if: github.event.pull_request.merged == true - with: - host: ${{ secrets.host }} - username: ${{ secrets.user }} - key: ${{ secrets.id }} - port: ${{ secrets.port }} - script: | - cd ${{ secrets.deploy_dir }} - . venv-prod/bin/activate - cd website - git pull - python -m pip install --upgrade pip - pip install --upgrade --force-reinstall -r prod_requirements.txt - python manage.py migrate - python manage.py collectstatic --noinput - python manage.py compilemessages - echo "${{ secrets.dingseboms_password }}" | sudo -S systemctl restart gunicorn + - name: executing remote ssh commands using key + uses: appleboy/ssh-action@v1.0.3 + with: + host: ${{ secrets.host }} + username: ${{ secrets.user }} + key: ${{ secrets.id }} + port: ${{ secrets.port }} + script: | + cd ${{ secrets.deploy_dir }} + . venv-prod/bin/activate + cd website + git pull + python -m pip install --upgrade pip + pip install --upgrade --force-reinstall -r prod_requirements.txt + python manage.py migrate + python manage.py collectstatic --noinput + python manage.py compilemessages + echo "${{ secrets.dingseboms_password }}" | sudo -S systemctl restart gunicorn diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 92ca91d3a..fd7c11935 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -5,31 +5,33 @@ on: branches: - master pull_request: + branches: + - master jobs: build: - runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - name: Set up Python 3.8 - uses: actions/setup-python@v1 - with: - python-version: 3.8 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install --upgrade --force-reinstall -r prod_requirements.txt - - name: Initialize Django - # Stop the build if migrations are not committed to repo. If action stops here, - # run `pt manage.py makemigrations` and commit the generated files. - run: | - python manage.py makemigrations --check - python manage.py migrate - - name: Run pre-commit hooks - run: | - pre-commit run --all-files - - name: Run Django tests - run: | - python manage.py test + - uses: actions/checkout@v4 + - name: Set up Python 3.10 + uses: actions/setup-python@v5 + with: + python-version: "3.10" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install --upgrade --force-reinstall -r prod_requirements.txt + - name: + Initialize Django + # Stop the build if migrations are not committed to repo. If action stops here, + # run `pt manage.py makemigrations` and commit the generated files. + run: | + python manage.py makemigrations --check + python manage.py migrate + - name: Run pre-commit hooks + run: | + pre-commit run --all-files + - name: Run Django tests + run: | + python manage.py test diff --git a/requirements.txt b/requirements.txt index abfe58555..d5b52c655 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ pre-commit==2.15.0 -Django==3.2.20 +Django==3.2.24 django-ckeditor==6.2.0 coverage==6.3.2 sorl-thumbnail==12.8.0 @@ -7,7 +7,7 @@ python-coveralls==2.9.3 djangorestframework==3.13.1 django-filter==21.1 Markdown==3.3.6 -Pillow==9.3.0 +Pillow==9.5.0 python-dataporten-auth==2.0.0 social-auth-app-django==5.0.0 rapidfuzz==1.8.2