-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add deployment to legislation parameters viewer (WIP)
- Loading branch information
Showing
1 changed file
with
85 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,91 @@ jobs: | |
parameters_path: "openfisca_tunisia/parameters" | ||
secrets: | ||
token: ${{ secrets.CONTROL_CENTER_TOKEN }} | ||
deploy: | ||
|
||
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 | ||
run: | | ||
mkdir -p ~/.ssh | ||
chmod 700 ~/.ssh | ||
cat >> ~/.ssh/known_hosts << EOF | ||
daudet.raviart.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDD4T3rwzzpgFQokpOfEwkSMzJB79WZVEkdd0WnMlVnAhKiqGpHFQELvv1ZdVQ6vvCA9Xj1u6mfqROIZxKoPk79KsL2MadjwQMRCcqvyubEwgyeWgXScOcLKcr5quW+EwKTOYtKg9q6TX62L2AHNcgmSuGRN2DkpQ8XttI25mdNfbdlbiK5UE0QqEUB2+uIXjuR9wbjmmQCGWhkXne8tZ82KNesiCgPa7W4TUeW4x//1EemR300M6V3WPnRqcybS0auAAC8p0jelggMoVyKTaXJ+sC1rQ1BcsIHyXjDBjCxtw/4PxU3L/ti7g4sXA3PD5UNm/ai15GWByx+qTk49QHiDWBINhctwPx90+w80/exLWQ9RiFCPNo2DLUEdAhSVb7jktJiMGTVaZtAQ2uNW7p5PTNrfT4/H//ZWuDA8lCrpXtaYJfhumwO/oGSC1MubVE56/Sb5Avg43tyYv7NN5G+Vj9/wg8SWkqpDwwcheqypCe0DZ3J47NXOGTFAEEtUV0= | ||
daudet.raviart.com ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBDDdlBQJfsBJf6KQe7GTS45VnZHjMHIOJAc0d6uXMr/NazEs81BI07jL5vEJkhYrBxOyzjIx03mXeUg0yZBy7eA= | ||
daudet.raviart.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBLAnUiDBKCeYsAiwVbZdCAOSGbr/RldWELb/DEgEc5u | ||
EOF | ||
chmod 644 ~/.ssh/known_hosts | ||
- name: Deploy to Server | ||
uses: easingthemes/ssh-deploy@main | ||
with: | ||
SSH_PRIVATE_KEY: ${{ secrets.PARAMETERS_EXPLORER_SSH_PRIVATE_KEY }} | ||
ARGS: "-az --delete" | ||
REMOTE_HOST: "10.131.0.2" | ||
REMOTE_USER: "parameters.tn.tax-benefit.org" | ||
SOURCE: "legislation-parameters-explorer/packages/viewer/build/" | ||
SSH_CMD_ARGS: "-J [email protected]:2222" | ||
TARGET: "public_html/" | ||
|
||
deploy_simulator: | ||
uses: tax-benefit/actions/.github/workflows/[email protected] | ||
with: | ||
python_package: "openfisca_tunisia" | ||
|