Add .htaccess file and copy it in pipeline
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Jim Martens 2023-08-12 19:16:42 +02:00
parent d3ecbba6f4
commit 0429ef9c4a
2 changed files with 17 additions and 0 deletions

View File

@ -27,6 +27,7 @@ steps:
commands:
- npm install
- npm run build:production
- cp /drone/src/.htaccess /drone/src/dist/wahlrecht-frontend/
- name: rebuild-cache
privileged: true
image: 2martens/drone-volume-cache
@ -58,6 +59,7 @@ steps:
- rm -rf html/*
- cp -r tmp/build/* html/
- rm -rf tmp/build
- restorecon -R -v html
- name: notify
pull: always
image: 2martens/drone-email

15
.htaccess Normal file
View File

@ -0,0 +1,15 @@
RewriteEngine On
RewriteBase /
RewriteRule ^../index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (..) $1/index.html [L]
RewriteCond %{HTTP:Accept-Language} ^de [NC]
RewriteRule ^$ /de/ [R]
RewriteCond %{HTTP:Accept-Language} ^!de [NC]
RewriteRule ^$ /en/ [R]