Logo

dev-resources.site

for different kinds of informations.

London Perl Mongers on GitHub Pages

Published at
1/4/2025
Categories
community
githubpages
londonperlmongers
londonpm
Author
davorg
Author
6 person written this
davorg
open
London Perl Mongers on GitHub Pages

The London Perl Mongers have had a website for a very long time. Since some time in 1998, I think. At first, I hosted a static site for us. Later on, we bought our own server and hosted it at a friendly company around Silicon Roundabout. But for most of the lifetime of the organisation, it’s been hosted on a server donated to us by Exonetric (for which we are extremely grateful).

But all good things come to an end. And last week, we got an email saying the Exonetric was closing down and we would need to find alternative hosting by the end of February.

The code for the site is on GitHub, so I had a quick look at it to see if there was anything easy we could do.

I was slightly surprised to find it was a PSGI application. Albeit a really simple PSGI application that basically served content from a /root directory, having passed it through some light Template Toolkit processing first. Converting this to a simple static site that could be hosted on GitHub Pages was going to be simple.

Really, all it needed was a ttree configuration file that reads all of the files from /root, processes them and writes the output to /docs. The configuration file I created looked like this:

src = root
dest = docs

copy = \.(gif|png|jpg|pdf|css|js)$
copy = ^CNAME$

recurse

verbose
Enter fullscreen mode Exit fullscreen mode

To be honest, most of the static web site work I do these days uses a static site builder that’s rather more complex than that, so it was really refreshing to remind myself that you can do useful things with tools as simple as ttree.

The next step was to add a GitHub Actions workflow that publishes the site to the GitHub Pages server each time something changes. That’s all pretty standard stuff too:

name: Generate web page

on:
  push:
    branches: 'master'
  workflow_dispatch:

jobs:
  build:
    if: github.repository_owner == 'LondonPM'
    runs-on: ubuntu-latest

    steps:
      - name: Install TT
        run: |
          sudo apt-get update
          sudo apt-get -y install libtemplate-perl

      - name: Checkout
        uses: actions/checkout@v4

      - name: Create pages
        run: ttree -f ttreerc 2>&1 > ttree.log

      - name: Archive ttree logs
        uses: actions/upload-artifact@v4
        with:
          name: ttree.log
          path: ./ttree.log
          retention-days: 3

      - name: Update pages artifact
        uses: actions/upload-pages-artifact@v3
        with:
          path: docs/

  deploy:
    needs: build
      if: github.repository_owner == 'LondonPM'
      permissions:
        pages: write
        id-token: write
      environment:
        name: github-pages
        url: ${{ steps.deployment.outputs.page_url }}
      runs-on: ubuntu-latest
      steps:
        - name: Deploy to GitHub Pages
          id: deployment
          uses: actions/deploy-pages@v4
Enter fullscreen mode Exit fullscreen mode

The only slightly complex lines here are the two lines that say if: github.repository_owner == 'LondonPM'. We’re hoping that other people will fork this repo in order to work on the site, but it’s only the main fork that should attempt to publish the current version on the GitHub Pages servers.

There was a bit of fiddling with DNS. Temporarily, we used the domain londonperl.com as a test deployment (because I’m the kind of person who just happens to have potentially useful domains lying around, unused!) but enough of us are slightly obsessed about using the correct TLD so we’ve settled on londonperl.org[*]. We’ve asked the nice people at the Perl NOC to redirect our old domain to the new one.

And it’s all working (well, with the exception of the redirection of the old domain). Thanks to Sue, Lee and Leo for the work they’ve done in the last few days to get it all working. And a big thanks to Mark and Exonetric for hosting the site for us for the last couple of decades.

These changes are already having the desired effect. People are submitting pull requests to update the website. Our website is probably more up-to-date than it has been for far too long. It’s even responsive now.

I realise there has been very little Perl in this post. But I thought it might be useful for other Perl Mongers groups who are looking for a simple (and free!) space to host their websites. Please let me know if you have any questions about the process.

[*] We wanted to use Cloudflare to manage the domain but their free service only supports top-level domains and london.pm.org (our original domain) is a subdomain – and none of us wanted to pay for the enterprise version.

The post London Perl Mongers on GitHub Pages appeared first on Perl Hacks.

githubpages Article's
30 articles in total
Favicon
London Perl Mongers on GitHub Pages
Favicon
Create Your Professional Resume Website with GitHub and Quarto
Favicon
Did You Know You Can Use GitHub to Host Your Site for Free?
Favicon
A refresher on GitHub Pages
Favicon
How to Deploy a React App to GitHub Pages
Favicon
How to Deploy an Express.js App on GitHub Pages Using GitHub Actions
Favicon
Create your portfolio with GitHub Pages
Favicon
Deploying React Apps to Github Pages with Github Actions
Favicon
Publicando suas paginas Flutter no Github Pages utilizando GitHub Action
Favicon
From Localhost to Live: Easy Deployment With Github Pages or Netlify
Favicon
Jekyll Docker
Favicon
Guia de Análise de Tráfego para GitHub Pages: Integração com Ferramentas de Analytics
Favicon
Um Guia Simples para Levar Seu Projeto Angular para o GitHub Pages
Favicon
How to: Deploy Angular Website to Github Pages
Favicon
Using GitHub Pages and Miss Hosting for DNS and Hosting
Favicon
Deploying Your Vite Apps to Github Pages is a Breeze with Vite Github Pages Deployer
Favicon
piratematt.com v3—Overview & Getting Started
Favicon
Host React app in GitHub pages
Favicon
404 There isn't a GitHub Pages site here.
Favicon
Deploy your React app using GitHub pages
Favicon
Why your GitHub action is not triggered by other actions
Favicon
Deploying GitHub Pages sites with GitHub Workflows
Favicon
This blog changes its theme every day
Favicon
Como criar um blog com Jekyll no GitHub Pages?
Favicon
Create a free static website using Github Pages and Jekyll
Favicon
Github Pages Tips if your img doesn't appear 🖼️
Favicon
Hosting static websites on GitHub pages
Favicon
Updating GitHub Pages using GitHub Actions
Favicon
What I learned from self-hosting a Supabase Svelte project: Part 2
Favicon
Using GitHub Pages and GitHub Actions to Deploy a React App ✨

Featured ones: