Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GH action to build an artifact for map.nycmesh.net #164

Merged
merged 18 commits into from
Nov 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/map-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Build distribution artifact for map.nycmesh.net

on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Run every 10 minutes to fetch new map updates from the database and create an artifact with the new data
schedule:
- cron: "*/10 * * * *"

# Default to bash
defaults:
run:
shell: bash

env:
NODE_OPTIONS: '--openssl-legacy-provider'

jobs:
# Build job
build:
runs-on: ubuntu-22.04
env:
HUGO_VERSION: 0.69.2
steps:
- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_Linux-64bit.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Install Dart Sass
run: sudo snap install dart-sass
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Node.js dependencies
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
- name: Update map
env:
STANDALONE_MAP_BUILD: true
run: sh update-map.sh
- name: Build with Hugo
env:
HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache
HUGO_ENVIRONMENT: production
run: |
hugo \
--minify \
--baseURL "https://nycmesh.net/"
- name: Build Map Payload
run: |
mkdir -p public/map/img/
mv public/img/map/ public/map/img/map/
mv public/favicon.ico public/map/favicon.ico
- name: Publish map site build for map.nycmesh.net to fetch and host
uses: actions/upload-artifact@v4
with:
name: map-site-build
path: public/map/
retention-days: 7
2 changes: 1 addition & 1 deletion content/map/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Hubs generally have a fast wireless connection and can connect other rooftops in

Supernodes (SN) have fiber connections. Two of our supernodes are located at data centers with backbone internet connections. Our third supernode "131 Broome" is connected via leased fiber to the 111 8th Ave data center.

If there is a supernode or hub node (blue dot) within range of your building, you may be able to join our network. The potential nodes are from our [join form](/join). We are working to turn these into active nodes by expanding our coverage and increasing our rate of installs.
If there is a supernode or hub node (blue dot) within range of your building, you may be able to join our network. The potential nodes are from our [join form]({{< ref "/join" >}}). We are working to turn these into active nodes by expanding our coverage and increasing our rate of installs.

The blue lines are over-the-air connections, yellow are fiber, purple are VPN and gray lines are speculative connections.

Expand Down
16 changes: 8 additions & 8 deletions layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="ph4-ns ph3 pv5">
<div class="mw8 center flex flex-wrap f5">
<div class="w-20-l w-100 flex items-start justify-start mb0-l mb4">
<a href="/" title="Home" class="f4 fw7 black mb0-l mb3">
<a href="{{ absURL "/" }}" title="Home" class="f4 fw7 black mb0-l mb3">
<div class="h2 w2">
{{ partial "logo.svg" . }}
</div>
Expand All @@ -13,10 +13,10 @@ <h4 class="f6 fw5 mt0 mb2 ttu">Community</h4>
<ul class="list ma0 pa0 flex flex-column items-start">
<li class="mv2"><a href="https://slack.nycmesh.net" class="link mid-gray">Slack</a></li>
<li class="mv2"><a href="https://meetup.com/nycmesh" class="link mid-gray">Meetup</a></li>
<li class="mv2"><a href="/volunteer" class="link mid-gray">Volunteer</a></li>
<li class="mv2"><a href="{{ absURL "/volunteer" }}" class="link mid-gray">Volunteer</a></li>
<li class="mv2"><a href="https://us9.campaign-archive.com/home/?u=cf667149616fd293afa115f5a&id=ebe72854f3" class="link mid-gray">Newsletter</a></li>
<li class="mv2"><a href="/blog" class="link mid-gray">Blog</a></li>
<li class="mv2"><a href="/coc" class="link mid-gray">Code of Conduct</a></li>
<li class="mv2"><a href="{{ absURL "/blog" }}" class="link mid-gray">Blog</a></li>
<li class="mv2"><a href="{{ absURL "/coc" }}" class="link mid-gray">Code of Conduct</a></li>
</ul>
</div>
<div class="w-20-l w-50 mb0-l mb4">
Expand All @@ -25,7 +25,7 @@ <h4 class="f6 fw5 mt0 mb2 ttu">Network</h4>
<li class="mv2"><a href="https://status.nycmesh.net" class="link mid-gray">Network Status</a></li>
<li class="mv2"><a href="https://stats.nycmesh.net" class="link mid-gray">Stats</a></li>
<li class="mv2"><a href="https://wiki.nycmesh.net/link/98#bkmrk-page-title" class="link mid-gray">Peering</a></li>
<li class="mv2"><a href="/sponsors" class="link mid-gray">Sponsors</a></li>
<li class="mv2"><a href="{{ absURL "/sponsors" }}" class="link mid-gray">Sponsors</a></li>
</ul>
</div>
<div class="w-20-l w-50 mb0-l">
Expand All @@ -34,10 +34,10 @@ <h4 class="f6 fw5 mt0 mb2 ttu">Resources</h4>
<li class="mv2"><a href="https://wiki.nycmesh.net/books/introduction/page/frequently-asked-questions" class="link mid-gray">FAQ</a></li>
<li class="mv2"><a href="https://wiki.nycmesh.net" class="link mid-gray" target="_">Documentation (Wiki)</a></li>
<li class="mv2"><a href="https://los.nycmesh.net" class="link mid-gray" target="_">Line of Sight</a></li>
<li class="mv2"><a href="/presentations" class="link mid-gray">Presentations</a></li>
<li class="mv2"><a href="{{ absURL "/presentations" }}" class="link mid-gray">Presentations</a></li>
<li class="mv2"><a href="https://wiki.nycmesh.net/link/123#bkmrk-page-title" class="link mid-gray" target="_">Outreach</a></li>
<li class="mv2"><a href="/pay" class="link mid-gray" target="_">Install Payment</a></li>
<li class="mv2"><a href="/orgdocs" class="link mid-gray">Public Records</a></li>
<li class="mv2"><a href="{{ absURL "/pay" }}" class="link mid-gray" target="_">Install Payment</a></li>
<li class="mv2"><a href="{{ absURL "/orgdocs" }}" class="link mid-gray">Public Records</a></li>
</ul>
</div>
<div class="w-20-l w-50">
Expand Down
10 changes: 5 additions & 5 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<header class="pa3 bg-white">
<div class="mw8 center w-100 flex items-center justify-between relative">
<div class="flex">
<a href="/" title="Home" class="f3-ns f4 fw7 black">
<a href="{{ absURL "/" }}" title="Home" class="f3-ns f4 fw7 black">
<div class="nowrap flex items-center">
<div class="h2 w2">
{{ partial "logo.svg" . }}
Expand All @@ -20,11 +20,11 @@
<a href="/map" class="ml3-ns black pointer-events">Map</a>
<a href="https://wiki.nycmesh.net/books/introduction/page/frequently-asked-questions" class="ml3-ns black pointer-events">FAQ</a>
<a href="https://wiki.nycmesh.net" class="ml3-ns black pointer-events">Docs/Wiki</a>
<a href="/blog" class="ml3-ns black pointer-events">Blog</a>
<a href="{{ absURL "/blog" }}" class="ml3-ns black pointer-events">Blog</a>
<a href="https://nycmesh.creator-spring.com/" class="ml3-ns black pointer-events">Merch</a>
<a href="/support" class="ml3-ns black pointer-events green fw5">Get Support</a>
<a href="/donate" class="ml3-ns black pointer-events">Donate</a>
<a href="/join" class="ml3-ns black pointer-events blue fw5">Get Connected</a>
<a href="{{ absURL "/support" }}" class="ml3-ns black pointer-events green fw5">Get Support</a>
<a href="{{ absURL "/donate" }}" class="ml3-ns black pointer-events">Donate</a>
<a href="{{ absURL "/join" }}" class="ml3-ns black pointer-events blue fw5">Get Connected</a>
</nav>
</div>
<script>
Expand Down
12 changes: 10 additions & 2 deletions update-map.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
#! /bin/sh
set -e
set -ex
rm -rf resources/node-map/
git clone https://github.com/olivernyc/node-map resources/node-map
git clone https://github.com/nycmeshnet/network-map resources/node-map
cd resources/node-map
if [ -n "$STANDALONE_MAP_BUILD" ]; then
sed -i.tmp 's|basename="/map"|basename="/"|' src/App.js
rm src/App.js.tmp
sed -i.tmp 's|href="/map/nodes/|href="/nodes/|' src/components/Stats/component.js
rm src/components/Stats/component.js.tmp
sed -i.tmp 's|"homepage": "/map"|"homepage": "/"|' package.json
rm package.json.tmp
fi
npm run update-data
npm install
npm run build
Expand Down