-
Notifications
You must be signed in to change notification settings - Fork 7
106 lines (92 loc) · 4.79 KB
/
tax-benefit.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
98
99
100
101
102
103
104
105
106
name: Validate, integrate & deploy to tax-benefit.org
on:
- push
- workflow_dispatch
jobs:
validate_yaml:
uses: tax-benefit/actions/.github/workflows/[email protected]
with:
parameters_path: "openfisca_tunisia/parameters"
secrets:
token: ${{ secrets.CONTROL_CENTER_TOKEN }}
deploy_parameters:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Clone Legislation Parameters Explorer
run: git clone https://git.leximpact.dev/leximpact/legislation-parameters-explorer.git
- name: Install Node.js version LTS
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- name: Install viewer dependencies
run: npm install
working-directory: legislation-parameters-explorer/packages/viewer
- name: Configure viewer
run: |
rm -f .env
cat > .env << EOF
# Customizations to apply to the site (theme, URLs…)
CUSTOMIZATION="openfisca"
DBNOMICS_DATASET_CODE="openfisca_tunisia"
DBNOMICS_PROVIDER_CODE="OpenFisca"
DBNOMICS_URL="https://db.nomics.world/"
EDITOR_URL="https://editors.parameters.tn.tax-benefit.org/"
EXPORT_CSV=true
EXPORT_JSON=false
EXPORT_XLSX=true
# Path of directory containing legislation parameters of country
PARAMETERS_DIR="../../../openfisca_tunisia/parameters/"
# Description of parameters remote repository
PARAMETERS_AUTHOR_EMAIL="[email protected]"
PARAMETERS_AUTHOR_NAME="Éditeur des paramètres d'OpenFisca-Tunisia"
PARAMETERS_BRANCH="master"
PARAMETERS_FORGE="gitlab.com"
PARAMETERS_GROUP="openfisca"
PARAMETERS_PROJECT="openfisca-tunisia"
PARAMETERS_PROJECT_DIR="openfisca_tunisia/parameters"
SHOW_LAST_BREADCRUMB_ITEM = false
# TABLE_OF_CONTENTS_DIR="../../../openfisca_tunisia/tables/"
TITLE="OpenFisca"
# Path of file containing units used by French legislation parameters
UNITS_FILE_PATH="../../../openfisca_tunisia/units.yaml"
EOF
working-directory: legislation-parameters-explorer/packages/viewer
- name: Initialize .svelte-kit directory of viewer
run: npx svelte-kit sync
working-directory: legislation-parameters-explorer/packages/viewer
- name: Generate data of viewer
run: npx tsx src/scripts/generate_data.ts
working-directory: legislation-parameters-explorer/packages/viewer
- name: Build viewer
run: npm run build
working-directory: legislation-parameters-explorer/packages/viewer
- name: Configure ssh for deployment to server
env:
SSH_PRIVATE_KEY: ${{ secrets.PARAMETERS_EXPLORER_SSH_PRIVATE_KEY }}
run: |
eval $(ssh-agent -s)
echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
mkdir -p ~/.ssh
chmod 700 ~/.ssh
cat >> ~/.ssh/known_hosts << EOF
# Result of ssh-keyscan -p 2222 parameters.tn.tax-benefit.org
# parameters.tn.tax-benefit.org:2222 SSH-2.0-OpenSSH_9.2p1 Debian-2+deb12u3
[parameters.tn.tax-benefit.org]:2222 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDS79gVwSy3CfWG5UNovhgZJS34vwflj7Sk9cFh0XfEBuGNnYTt4YHo0a8NcufbhXeKRNcGwvx7QxNRzgQfuCKi+HuWhOcxhCzoNSPbLfuEKF+qZfvY1Bz+a/C5/EptweF8fj+jnRBhTqfpgxkUGMVrebzbAx8gWLY6wZD+BDFmSTVQcPkq2pqEXX8cW0cgMPbeaifknmyeEp5UlS5oUeLJ7M29b9P6/k0d+rUUGWdflPB8sEqoli2MfZgqUMGZuVxRrForm17D6LAbdbMkqBYG3N/r4ypMhgPxq7P2C3fpe8rQi2hChRP5ZprmYGD1ZoUbauFvA+D5bB8FsjVcQCcHSjrqa48w+nqEXG665ny/K2arStvgW0JDk6C5oajCdoNzCMRc0GfiJME/IE2IlrY4NTZb/nX8ymD2Rpam6Gt7n1qwFHo0l7WzPXAACd1wd//4X8CkTMgpvtdWnYvu2Xg1ibzQu+YK/pLfBR0GClCP13HEoufuYC7X1zazG/vuvsU=
# parameters.tn.tax-benefit.org:2222 SSH-2.0-OpenSSH_9.2p1 Debian-2+deb12u3
[parameters.tn.tax-benefit.org]:2222 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEtIEVpN2Fc8OiDhRx66xmKycWNAjg3pnUQxQKGqnyEWydpT0+w0b11n/jbz6Nb9ZYo0oIFlTBboDDPKqzY0S2A=
# parameters.tn.tax-benefit.org:2222 SSH-2.0-OpenSSH_9.2p1 Debian-2+deb12u3
[parameters.tn.tax-benefit.org]:2222 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDM/Q1D3k4z9bqBArZxJGuLAK7IhPNlTkb6uOA002R1E
# parameters.tn.tax-benefit.org:2222 SSH-2.0-OpenSSH_9.2p1 Debian-2+deb12u3
# parameters.tn.tax-benefit.org:2222 SSH-2.0-OpenSSH_9.2p1 Debian-2+deb12u3
EOF
chmod 644 ~/.ssh/known_hosts
- name: Deploy to Server using rsync
run: rsync -az --delete -e "ssh -vvv -J [email protected]:2222" build/ [email protected]:public_html/
working-directory: legislation-parameters-explorer/packages/viewer
deploy_simulator:
uses: tax-benefit/actions/.github/workflows/[email protected]
with:
python_package: "openfisca_tunisia"
secrets:
token: ${{ secrets.CONTROL_CENTER_TOKEN }}