build: split build process into multiple GH actions

This commit is contained in:
Pieter Vander Vennet 2023-05-19 11:23:17 +02:00
parent 562e01b117
commit 4d5695e3f1
3 changed files with 17 additions and 4 deletions

View file

@ -17,6 +17,22 @@ runs:
- name: create generated dir
run: mkdir ./assets/generated
shell: bash
- name: create dependencies
run: npm run generate:licenses; npm run generate:images; npm run generate:charging-stations; npm run generate:service-worker
shell: bash
- name: sync translations
run: npm run generate:translations
shell: bash
- name: generate layeroverview
run: npm run reset:layeroverview
shell: bash
- name: run tests
run: npm run test
shell: bash
- name: Prepare deploy
run: npm run prepare-deploy

View file

@ -34,7 +34,7 @@
"generate:service-worker": "tsc service-worker.ts --outFile public/service-worker.js && git_hash=$(git rev-parse HEAD) && sed -i \"s/GITHUB-COMMIT/$git_hash/\" public/service-worker.js",
"optimize-images": "cd assets/generated/ && find -name '*.png' -exec optipng '{}' \\; && echo 'PNGs are optimized'",
"generate:stats": "vite-node scripts/GenerateSeries.ts",
"reset:layeroverview": "echo {\\\"themes\\\":[]} > ./assets/generated/known_themes.json && echo {\\\"layers\\\": []} > ./assets/generated/known_layers.json && rm -f ./assets/generated/layers/*.json && rm -f ./assets/generated/themes/*.json && npm run generate:layeroverview && vite-node scripts/generateLayerOverview.ts -- --force",
"reset:layeroverview": "mkdir -p ./assets/generated/layers; echo {\\\"themes\\\":[]} > ./assets/generated/known_themes.json && echo {\\\"layers\\\": []} > ./assets/generated/known_layers.json && rm -f ./assets/generated/layers/*.json && rm -f ./assets/generated/themes/*.json && cp ./assets/layers/usersettings/usersettings.json ./assets/generated/layers/usersettings.json && npm run generate:layeroverview && vite-node scripts/generateLayerOverview.ts -- --force",
"generate": "mkdir -p ./assets/generated; npm run generate:licenses; npm run generate:images; npm run generate:charging-stations; npm run generate:translations; npm run reset:layeroverview; npm run generate:service-worker",
"generate:charging-stations": "cd ./assets/layers/charging_station && vite-node csvToJson.ts && cd -",
"prepare-deploy": "npm run generate:service-worker && ./scripts/build.sh",

View file

@ -14,9 +14,6 @@ export NODE_OPTIONS="--max-old-space-size=8192"
# This script ends every line with '&&' to chain everything. A failure will thus stop the build
npm run generate:editor-layer-index &&
npm run generate &&
npm run generate:translations &&
npm run test &&
npm run generate:layeroverview &&
npm run generate:layouts
if [ $? -ne 0 ]; then