Skip to content

Commit 1a6fd35

Browse files
author
cgl
committed
Merge branch 'leximpact_legislation_explorer' into wip-leximpact
2 parents ec2a204 + d986525 commit 1a6fd35

File tree

2 files changed

+79
-1
lines changed

2 files changed

+79
-1
lines changed

.github/workflows/leximpact.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Deploy to LexImpact Legislation Explorer
2+
3+
on:
4+
- push
5+
- workflow_dispatch
6+
7+
jobs:
8+
deploy_parameters:
9+
if: github.ref == 'refs/heads/wip-leximpact'
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Clone Legislation Parameters Explorer
15+
run: git clone https://git.leximpact.dev/leximpact/legislation-parameters-explorer.git
16+
- name: Install Node.js version LTS
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: "lts/*"
20+
- name: Install viewer dependencies
21+
run: npm install
22+
working-directory: legislation-parameters-explorer/packages/viewer
23+
- name: Configure viewer
24+
run: |
25+
rm -f .env
26+
cat > .env << EOF
27+
# Customizations to apply to the site (theme, URLs…)
28+
CUSTOMIZATION="leximpact"
29+
30+
EDITOR_URL="https://editeur.legislation.leximpact.dev/"
31+
32+
EXPORT_CSV=true
33+
EXPORT_JSON=false
34+
EXPORT_XLSX=true
35+
36+
# Path of directory containing legislation parameters of country
37+
PARAMETERS_DIR="../../../openfisca_france/parameters/"
38+
39+
# Description of parameters remote repository
40+
PARAMETERS_AUTHOR_EMAIL="editeur.legislation@leximpact.dev"
41+
PARAMETERS_AUTHOR_NAME="Éditeur LexImpact"
42+
PARAMETERS_BRANCH="wip-leximpact"
43+
PARAMETERS_FORGE_DOMAIN_NAME="github.com"
44+
PARAMETERS_FORGE_TYPE="GitHub"
45+
PARAMETERS_GROUP="openfisca"
46+
PARAMETERS_PROJECT="openfisca-france"
47+
PARAMETERS_PROJECT_DIR="openfisca_france/parameters"
48+
49+
SHOW_LAST_BREADCRUMB_ITEM = false
50+
51+
TABLE_OF_CONTENTS_DIR="../../../openfisca_france/tables/"
52+
53+
TITLE="Législation du système fiscal et social"
54+
55+
# Path of file containing units used by French legislation parameters
56+
UNITS_FILE_PATH="../../../openfisca_france/units.yaml"
57+
EOF
58+
working-directory: legislation-parameters-explorer/packages/viewer
59+
- name: Initialize .svelte-kit directory of viewer
60+
run: npx svelte-kit sync
61+
working-directory: legislation-parameters-explorer/packages/viewer
62+
- name: Generate viewer data
63+
run: npx tsx src/scripts/generate_data.ts
64+
working-directory: legislation-parameters-explorer/packages/viewer
65+
- name: Build viewer
66+
run: npm run build
67+
working-directory: legislation-parameters-explorer/packages/viewer
68+
- name: Configure ssh for deployment to server
69+
uses: tanmancan/action-setup-ssh-agent-key@1.0.0
70+
with:
71+
ssh-auth-sock: /tmp/my_auth.sock
72+
ssh-private-key: ${{ secrets.PARAMETERS_EXPLORER_SSH_PRIVATE_KEY }}
73+
ssh-public-key: ${{ secrets.PARAMETERS_EXPLORER_SSH_KNOWN_HOSTS }}
74+
- name: Deploy to Server using rsync
75+
run: rsync -az --delete build/ legislation@legislation.leximpact.dev:legislation-parameters-explorer-france/packages/viewer/build/
76+
working-directory: legislation-parameters-explorer/packages/viewer
77+
- name: Update editor parameters data
78+
run: ssh legislation@legislation.leximpact.dev "cd openfisca-france && git fetch && git reset --hard origin/leximpact_legislation_explorer && sudo systemctl restart legislation-edit.service"

.github/workflows/validate_yaml.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
jobs:
1010
validate_yaml:
11-
uses: tax-benefit/actions/.github/workflows/validate_yaml.yml@v1
11+
uses: tax-benefit/actions/.github/workflows/validate_yaml.yml@v2.1.0
1212
with:
1313
parameters_path: "openfisca_france/parameters"
1414
secrets:

0 commit comments

Comments
 (0)