Skip to content

Merge pull request #882 from philgyford/dependabot/pip/boto3-1.35.57 #347

Merge pull request #882 from philgyford/dependabot/pip/boto3-1.35.57

Merge pull request #882 from philgyford/dependabot/pip/boto3-1.35.57 #347

name: test-and-deploy
on:
push:
branches:
- main
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
# Run the tests first:
use-test:
uses: philgyford/django-hines/.github/workflows/test.yml@main
deploy:
needs: use-test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Deploy
uses: appleboy/[email protected]
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USERNAME }}
key: ${{ secrets.DEPLOY_KEY }}
script: |
cd /webapps/hines/code
git checkout .
git pull
source venv/bin/activate
pip-sync
./manage.py migrate
./manage.py collectstatic --noinput
sudo systemctl restart gunicorn_hines
sudo systemctl restart djangoq_hines
- name: Slack notification
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
# fields: repo,message,commit,author,action,eventName,ref,workflow,job,took # selectable (default: repo,message)
fields: repo,workflow,message,commit,action,took
env:
SLACK_WEBHOOK_URL: ${{ secrets.ACTIONS_CI_SLACK_HOOK }} # required
# Run even if job fails/cancelled, but only if Slack webhook is present (it's not when Dependabot runs):
if: ${{ always() && env.SLACK_WEBHOOK_URL != null }}