Skip to content

Commit

Permalink
Change hugo env to prod and simplify github run conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
noxilixon committed Nov 28, 2023
1 parent c9373eb commit a2ada6d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,14 @@ jobs:
extended: true

- name: Build
env:
HUGO_ENV: production
run: hugo --minify -b $URL_DEVELOPMENT/$GITHUB_REF_NAME --destination branch/$GITHUB_REF_NAME

- name: Create robots.txt
description: Because we use prod env we have to explicitly create a disallow robots.txt and place it so that it is deployed to the webroot.
run: 'echo "User-agent: *\nDisallow: /\nSitemap: /sitemap.xml" > branch/robots.txt'

- name: Deploy
uses: appleboy/scp-action@master
with:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- main
pull_request:

jobs:
deploy:
Expand All @@ -24,6 +23,8 @@ jobs:
extended: true

- name: Build
env:
HUGO_ENV: production
run: hugo --minify -b $URL_PRODUCTION

- name: Deploy
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ hugo build --minify -b <DOMAIN>

The website is deployed automatically via github actions. The main branch is at [berlin.freifunk.net](https://berlin.freifunk.net). The other branches could be accessed via `dev.berlin.freifunk.net/<BRANCH_NAME>/`.

The actions are defined in `.github/workflows` and could be configured with [github variables and secrets](https://github.com/freifunk-berlin/berlin.freifunk.net/settings/secrets/actions). The configurations for the production and development webserver are in the `apache` directory. The development setup should also use the `robots.txt` file to deny indexing.
The actions are defined in `.github/workflows` and could be configured with [github variables and secrets](https://github.com/freifunk-berlin/berlin.freifunk.net/settings/secrets/actions). The configurations for the production and development webserver are in the `apache` directory.
2 changes: 0 additions & 2 deletions apache/robots.txt

This file was deleted.

0 comments on commit a2ada6d

Please sign in to comment.