-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (64 loc) · 2.08 KB
/
Copy pathbuild.yml
File metadata and controls
64 lines (64 loc) · 2.08 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Build and deploy
on:
workflow_dispatch:
push:
schedule:
- cron: "0 * * * *"
jobs:
build-and-deploy:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/cache@v3
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.13"
- name: Build
run: |
pip install -r ./requirements.txt
python site.py build
env:
MAPBOX_TOKEN: ${{ secrets.MAPBOX_TOKEN }}
- name: Clone bartek/hfxbenches
uses: actions/checkout@v4
with:
repository: bartek/hfxbenches
path: ./hfxbenches
- name: Copy hfxbenches GeoJSON to build directory
run: |
cp hfxbenches/data.geojson build/static/hfxbenches.geojson
- name: Clone bartek/hfxbikeparking
uses: actions/checkout@v4
with:
repository: bartek/hfxbikeparking
path: ./hfxbikeparking
- name: Copy hfxbikeparking GeoJSON to build directory
run: |
cp hfxbikeparking/data.geojson build/static/hfxbikeparking.geojson
- name: Copy counter_chnanels GeoJSON to build directory
run: |
cp hfxbikeparking/counter_channels.geojson build/static/counter_channels.geojson
- 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