-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (46 loc) · 1.4 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Checks
on:
push:
branches: [ master ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: 3.6
- uses: actions/cache@v1
with:
path: ./pyenv
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Prepare dependencies
run: |
python -m venv ./pyenv
source pyenv/bin/activate
pip install -r requirements.txt
cp config/example_config.json_copy config/develop.json
- name: Run tests
run: |
source pyenv/bin/activate
python manage.py check
deploy:
runs-on: ubuntu-latest
needs: [ test ]
steps:
- uses: webfactory/ssh-agent@v0.2.0
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- run: |
ssh-keyscan ${DEPLOY_HOST} >> ~/.ssh/known_hosts
ssh ${DEPLOY_USER}@${DEPLOY_HOST} -A "ls -al"
env:
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2.0.0
env:
SLACK_MESSAGE: 'Nueva version de https://hacktivistas.com/ esta en linea! :rocket:'
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}