-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (42 loc) · 1.23 KB
/
build.yml
File metadata and controls
42 lines (42 loc) · 1.23 KB
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
name: Build and deploy
on:
push:
schedule:
- cron: "0 * * * *"
jobs:
build-and-deploy:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8.6"
- name: Build
run: |
pip install -r ./requirements.txt
python site.py build
- name: Upload to droplet
shell: bash
run: |
mkdir -p ~/.ssh
touch ~/.ssh/id_rsa ~/.ssh/known_hosts
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa ~/.ssh/known_hosts
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
echo "${{ secrets.SSH_KNOWN_HOSTS }}" > ~/.ssh/known_hosts
scp \
-o StrictHostKeyChecking=yes \
-P ${{ secrets.SSH_PORT }} \
-o CheckHostIP=no \
-r build/* \
bartekc@${{ secrets.SSH_HOST }}:/home/bartekc/justbartek.ca