Skip to content

Commit

Permalink
Serve dev and prod from same dir on server
Browse files Browse the repository at this point in the history
  • Loading branch information
noxilixon committed Dec 13, 2023
1 parent a273b2d commit f80d9d8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Deploy website to dev server

on:
push:
branches-ignore:
- main
push:
branches-ignore:
- main

jobs:
deploy:
Expand All @@ -27,9 +27,6 @@ jobs:
HUGO_ENV: production
run: hugo --minify -b $URL_DEVELOPMENT/$GITHUB_REF_NAME --destination branch/$GITHUB_REF_NAME

- name: Create robots.txt
run: 'echo -e "User-agent: *\nDisallow: /" > branch/robots.txt'

- name: Deploy
uses: appleboy/scp-action@master
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Deploy website to production server

on:
push:
branches:
branches-ignore:
- main

jobs:
Expand All @@ -25,7 +25,7 @@ jobs:
- name: Build
env:
HUGO_ENV: production
run: hugo --minify -b $URL_PRODUCTION
run: echo $URL_PRODUCTION && hugo --minify

- name: Deploy
uses: appleboy/scp-action@master
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
public/
.hugo_build.lock
resources/_gen/
www/
www-dev/
8 changes: 4 additions & 4 deletions apache/dev.website.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
SSLCertificateChainFile /etc/letsencrypt/live/dev.ff.berlin/chain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/dev.ff.berlin/privkey.pem

DocumentRoot /var/www/dev.berlin.freifunk.net/www/dev
DocumentRoot /var/www/berlin.freifunk.net/www-dev

<Directory "/var/www/dev.berlin.freifunk.net/www">
<Directory "/var/www/berlin.freifunk.net/www-dev">
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>

ErrorLog "/var/log/apache2/dev.berlin.freifunk.net-error.log"
CustomLog "/var/log/apache2/dev.berlin.freifunk.net-access.log" combined
ErrorLog "/var/log/apache2/berlin.freifunk.net-error.log"
CustomLog "/var/log/apache2/berlin.freifunk.net-access.log" combined
</VirtualHost>

0 comments on commit f80d9d8

Please sign in to comment.