-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (82 loc) · 2.46 KB
/
deploy-dev.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Pre-requisites
#
# You need either to have set the following environment secrets:
#
# DEPLOY_KEY - Private key for an SSH key with (at least) read only access to the bradford-2025/open-data-pipelines project
# The deploy key is one of the ones set in https://github.com/bradford-2025/open-data-pipelines/settings/keys
#
# SSH_HOST - host to deploy the site to
# SSH_USER - user for deployment
# SSH_PASS - password for the user
# SSH_PATH - path on the host to deploy to
name: Deploy dev
"on":
workflow_dispatch: {}
push:
branches: [dev]
paths:
- src/**
- data/**/*.dvc
- pipelines/**
- _config.ts
- deno.json
- .github/workflows/deploy-dev.yml
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# Build job
dev-build:
if: github.ref == 'refs/heads/dev'
runs-on: ubuntu-latest
env:
DENO_DIR: /var/tmp/deno_cache
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pipenv
- name: Setup pipenv
run: |
pip install pipenv
pipenv install
- name: Setup deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- name: Cache Deno dependencies
id: cache-deno
uses: actions/cache@v4
with:
key: deno-cache-${{ hashFiles('./deno.lock') }}
path: ${{ env.DENO_DIR }}
- name: Get current data
run: |
umask 077
eval $(ssh-agent -s)
echo "${{ secrets.DEPLOY_KEY }}" > deploy-key
ssh-add deploy-key
pipenv run dvc update data/published.dvc data/metadata.dvc
ssh-add -D
echo "${{ secrets.DEPLOY_KEY_HUQ }}" > deploy-key-huq
ssh-add deploy-key-huq
pipenv run dvc update data/huq.dvc
ssh-add -D
- name: Run pipelines
run: |
pipenv run dvc repro pipelines/dvc.yaml
- name: Build the dev site
run: deno task build:dev
- name: Deploy the dev site to bytemark
run: |
# apt update
# apt install -y rsync sshpass
deno task deploy:dev
env:
SSH_HOST: ${{ secrets.SSH_HOST }}
SSH_PATH: ${{ secrets.SSH_PATH }}
SSH_USER: ${{ secrets.SSH_USER }}
SSHPASS: ${{ secrets.SSH_PASS }}