Skip to content

Commit

Permalink
github(workflows): add pages deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
AnInternetTroll committed Sep 9, 2024
1 parent f38e3f6 commit d5ce438
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 2 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Deploy site

on:
push:
branches: [$default-branch]

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

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

# Default to bash
defaults:
run:
shell: bash

jobs:
# Build job
build:
runs-on: ubuntu-latest
container:
image: ghcr.io/void-linux/void-glibc-full:latest
defaults:
run:
shell: sh
steps:
- name: Install build dependencies
run: |
xbps-install -Syu || xbps-install -Syu xbps
xbps-install -yu
xbps-install -y mmv-rs hugo git bash
- name: Checkout
id: checkout
uses: classabbyamp/treeless-checkout-action@v1
- name: Get rules
run: |
git clone --depth=1 https://github.com/MCBE-Speedrunning/Speedrunning-Rulebook content/rules
./build.sh
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Build with Hugo
env:
HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache
HUGO_ENVIRONMENT: production
run: |
hugo \
--minify \
--baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./public

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
2 changes: 1 addition & 1 deletion themes/minecraft/layouts/partials/header.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<h1>{{ site.Title }}</h1>
<img src="/banner.png" height="50px" width="auto" />
<img src="{{ .Site.BaseURL }}banner.png" height="50px" width="auto" />
{{ partial "menu.html" (dict "menuID" "main" "page" .) }}

0 comments on commit d5ce438

Please sign in to comment.