Skip to content
Draft
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
59 changes: 24 additions & 35 deletions .github/workflows/broadcast.yaml
Original file line number Diff line number Diff line change
@@ -1,47 +1,36 @@
name: Broadcast

on:
workflow_dispatch:
inputs:
event:
description: "Event directory slug, e.g. 45 or sfd-1404"
type: string
required: true
environment:
description: "Destination"
type: choice
description: 'choose the environment'
options: [test, production]
default: test
required: true
default: 'test'
options:
- 'test'
- 'production'

permissions:
contents: read
jobs:
broadcast:
runs-on: ubuntu-latest
environment: broadcast

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 2

- name: prepare
run: |
pip install -r ./tools/requirements.txt

if [ "${{ github.event.inputs.environment }}" == "test" ]; then
echo "setting up test environment"
echo "CHAT_ID=${{ vars.TEST_CHAT_ID }}" >> $GITHUB_ENV
echo "TEST=1" >> $GITHUB_ENV
else
echo "setting up production environment"
echo "CHAT_ID=${{ vars.CHAT_ID }}" >> $GITHUB_ENV
echo "TEST=0" >> $GITHUB_ENV
fi

- name: notify
run: ./tools/notify.sh
env:
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
CHAT_ID: ${{ env.CHAT_ID }}
MASTODON_TOKEN: ${{ secrets.MASTODON_TOKEN }}
MASTODON_URL: ${{ vars.MASTODON_URL }}
TEST: ${{ env.TEST }}
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.13"
- run: python -m pip install -r tools/requirements.txt
- name: Notify
env:
EVENT: ${{ inputs.event }}
TEST: ${{ inputs.environment == 'test' && '1' || '0' }}
CHAT_ID: ${{ inputs.environment == 'test' && vars.TEST_CHAT_ID || vars.CHAT_ID }}
MEDIA_BASE_URL: ${{ vars.MEDIA_BASE_URL }}
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
MASTODON_TOKEN: ${{ secrets.MASTODON_TOKEN }}
MASTODON_URL: ${{ vars.MASTODON_URL }}
run: bash tools/notify.sh
105 changes: 61 additions & 44 deletions .github/workflows/hugo.yaml
Original file line number Diff line number Diff line change
@@ -1,70 +1,87 @@
name: Deploy birlug.github.io
name: Deploy BirLUG

on:
push:
branches:
- master
paths-ignore:
- 'README.md'
branches: [master]
paths-ignore: [README.md, DESIGN.md, SYSTEM-DESIGN.md]
pull_request:
workflow_dispatch:
schedule:
- cron: "17 2 * * *"

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

defaults:
run:
shell: bash
group: "pages-${{ github.ref }}"
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
pages: read
defaults:
run:
working-directory: site
env:
HUGO_VERSION: 0.124.0
HUGO_VERSION: 0.167.0
HUGO_PARAMS_MEDIABASEURL: ${{ vars.MEDIA_BASE_URL }}
steps:
- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Install Dart Sass
run: sudo snap install dart-sass
- name: Checkout
uses: actions/checkout@v4
- uses: actions/checkout@v7
with:
submodules: recursive
fetch-depth: 0
- name: Setup Pages
path: site
- name: Read Pages URL
id: pages
uses: actions/configure-pages@v4
- name: Install Node.js dependencies
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
- name: Build with Hugo
uses: actions/configure-pages@v6
- name: Checkout media
uses: actions/checkout@v7
with:
repository: birlug/media
ref: main
path: birlug-media
token: ${{ secrets.MEDIA_READ_TOKEN || github.token }}
- uses: actions/setup-python@v7
with:
python-version: "3.13"
- uses: actions/setup-node@v7
with:
node-version: "24"
- name: Install tools
run: |
python -m pip install -r tools/requirements.txt
npm ci --ignore-scripts
npm run icons
archive="hugo_${HUGO_VERSION}_linux-amd64.tar.gz"
curl --fail --location --retry 3 "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/${archive}" -o "/tmp/${archive}"
curl --fail --location --retry 3 "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_checksums.txt" -o /tmp/hugo-checksums.txt
(cd /tmp && grep " ${archive}$" hugo-checksums.txt | sha256sum --check -)
tar -xzf "/tmp/${archive}" -C /tmp hugo
- name: Validate and build
env:
HUGO_ENVIRONMENT: production
HUGO_ENV: production
PAGES_BASE_URL: ${{ steps.pages.outputs.base_url }}
run: |
hugo \
--gc \
--minify \
--baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
test -d ../birlug-media/public/media
cp ../birlug-media/public/catalog.json data/media.json
python tools/content.py
/tmp/hugo --baseURL "${PAGES_BASE_URL%/}/" --gc --minify --panicOnWarning --cleanDestinationDir
python tools/check_site.py public --base-url "${PAGES_BASE_URL%/}/"
- uses: actions/upload-pages-artifact@v5
if: github.event_name != 'pull_request'
with:
path: ./public
path: site/public

deploy:
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
- uses: actions/deploy-pages@v5
id: deployment
uses: actions/deploy-pages@v4


11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
/public
.hugo_build.lock
/resources
/.venv
/__pycache__
/tools/__pycache__
/data/events.json
/static/calendar.ics
/static/events/*/calendar.ics
/assets/events/
/static/media/
/node_modules/
/assets/icons/ui.svg
/LUG Website.html
Loading