Skip to content

Commit

Permalink
Create deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmunz authored Dec 18, 2019
1 parent 2b1c72a commit f09115b
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build and Deploy

on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m venv venv
venv/bin/pip install -r requirements.txt
- name: Lint and test
run: |
venv/bin/flake8 .
venv/bin/pytest
- name: Deploy the build
id: deploy
uses: Pendect/action-rsyncer@v1.1.0
env:
DEPLOY_KEY: ${{secrets.DEPLOY_KEY}}
with:
flags: '-avzr --delete'
options: ''
ssh_options: ''
src: 'decidel.ini default_config.py wsgi.py decidel venv'
dest: ${{ secrets.DEPLOY_DESTINATION }}
- name: Display status from deploy
run: echo "${{ steps.deploy.outputs.status }}"
- name: Restart the app
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USERNAME }}
key: ${{ secrets.DEPLOY_KEY }}
script: systemctl restart decidel

0 comments on commit f09115b

Please sign in to comment.