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

fix: update the workflows #796

Merged
merged 3 commits into from
Mar 7, 2024
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
41 changes: 19 additions & 22 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: Deploy to Server

on:
pull_request:
# Change to merge when implemented (still beta)
types: [closed]
push:
branches:
- master

Expand All @@ -12,22 +10,21 @@ jobs:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: executing remote ssh commands using key
uses: appleboy/[email protected]
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/[email protected]
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
46 changes: 24 additions & 22 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
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
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
Expand Down