Skip to content

Commit

Permalink
Keep settings.js and modify index.html when adding new build #70
Browse files Browse the repository at this point in the history
  • Loading branch information
caebr committed Oct 25, 2023
1 parent bc5cfdd commit 3ea91db
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/buildDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,14 @@ jobs:

- name: Commit
run: |
rsync -av --exclude=settings.js --delete dist/webapp-schulverwaltung/ evento-portal/public/apps/webapp-schulverwaltung/
# Replace all files except settings.js and index.html with the new build, deleting any unnecessary existing files
rsync -av --exclude={settings.js,index.html} --delete dist/webapp-schulverwaltung/ evento-portal/public/apps/webapp-schulverwaltung/
# Replace the styles in the existing index.html with those generated by the new build
# Slashes and backslashes have to be escaped in sed's input string
TMP=$(grep -o '<style>@import.*</noscript>' dist/webapp-schulverwaltung/index.html | sed 's/\\/\\\\/g' | sed 's/\//\\\//g')
sed -i "s/.*@import.*/ $TMP/" evento-portal/public/apps/webapp-schulverwaltung/index.html
cd ./evento-portal
git add .
git status
Expand Down

0 comments on commit 3ea91db

Please sign in to comment.