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 b11a031
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
10 changes: 4 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 @@ -25,11 +25,9 @@ jobs:
- name: Build
env:
HUGO_ENV: production
URL_DEVELOPMENT: ${{ vars.URL_DEVELOPMENT }}
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
5 changes: 3 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,6 +25,7 @@ jobs:
- name: Build
env:
HUGO_ENV: production
URL_PRODUCTION: ${{ vars.URL_PRODUCTION }}`
run: hugo --minify -b $URL_PRODUCTION

- name: Deploy
Expand All @@ -34,5 +35,5 @@ jobs:
username: ${{ secrets.SSH_USERNAME_PRODUCTION }}
key: ${{ secrets.SSH_KEY_PRODUCTION }}
source: "public/"
target: ${{ secrets.WEBROOT_PRODUCTION }}
target: ${{ vars.WEBROOT_PRODUCTION }}
strip_components: 1
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 b11a031

Please sign in to comment.