Skip to content

Commit

Permalink
WIP: node list workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
noxilixon committed Dec 16, 2023
1 parent db44512 commit 4cf0d03
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,20 @@ jobs:
hugo-version: '0.119.0'
extended: true

- name: Build
- name: Build Hugo
env:
HUGO_ENV: production
URL_DEVELOPMENT: ${{ vars.URL_DEVELOPMENT }}
run: hugo --minify -b "$URL_DEVELOPMENT/$GITHUB_REF_NAME" --destination "branch/$GITHUB_REF_NAME"

- name: Update nodes count
"run": |
cd branch/$GITHUB_REF_NAME
LASTCHANGE=$(date --iso-8601=seconds)
sed -i "/\"lastchange\":/c\ \"lastchange\":\"$LASTCHANGE\"," static/berlin.json
NODECOUNT=$(curl -s "https://hopglass.berlin.freifunk.net/nodes.json" | jq ".nodes | length")
sed -i "/\"nodes\":/c\ \"nodes\":$NODECOUNT" static/berlin.json
- name: Create robots.txt
run: 'echo -e "User-agent: *\nDisallow: /" > branch/robots.txt'

Expand Down
4 changes: 2 additions & 2 deletions static/static/berlin.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
"Public Free Wifi",
"Free internet access"
],
"lastchange":"2023-12-14T19:01:04+01:00",
"nodes":531
"lastchange": "PLACEHOLDER",
"nodes": "PLACEHOLDER"
},
"techDetails": {
"firmware": {
Expand Down

0 comments on commit 4cf0d03

Please sign in to comment.