Skip to content

Make link to home config dependent #6

Make link to home config dependent

Make link to home config dependent #6

Workflow file for this run

name: Zola
on:
push:
branches: redesign
pull_request:
jobs:
zola:
runs-on: ubuntu-latest
env:
BASE_URL: https://github.com/getzola/zola/releases/download
VERS: v0.19.1
ARCH: x86_64-unknown-linux-gnu
# https://github.com/crazy-max/ghaction-github-pages/issues/1#issuecomment-623202206
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }}
- name: Get changed files
id: changed-files
# source: https://stackoverflow.com/a/74268200, added filtering for markdown files
run: |
if ${{ github.event_name == 'pull_request' }}; then
changed_files=$(git diff --name-only -r HEAD^1 HEAD -z | grep '\.md$' -zZ | xargs -0)
else
changed_files=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} -z | grep '\.md$' -zZ | xargs -0)
fi
echo "changed_files: $changed_files"
echo "changed_files=$changed_files" >> $GITHUB_OUTPUT
# - name: Lint
# uses: avto-dev/markdown-lint@v1
# with:
# args: '.'
# config: '.markdownlint.json'
- name: Check links
uses: lycheeverse/[email protected]
if: ${{ steps.changed-files.outputs.changed_files != '' }}
with:
fail: true
args: >-
--verbose
--no-progress
--accept '100..=103,200..=299,300..=399'
--exclude '[^\w]todo[^\w]?'
--exclude 'https://(www\.|old\.)?reddit\.com'
--exclude 'https://www.patreon.com'
--exclude 'https://gamedev.social'
--exclude 'dev.epicgames.com'
--exclude-path 'assets/logo/readme.md'
${{ steps.changed-files.outputs.changed_files }}
- name: Install Zola
run: |
curl -L ${BASE_URL}/${VERS}/zola-${VERS}-${ARCH}.tar.gz | tar -xz
echo "Zola version: $(./zola --version)"
- name: Zola build
run: ./zola build --base-url 'https://tau.garden/rust-gamedev.github.io'
- name: Upload GitHub Pages Artifact
uses: actions/upload-pages-artifact@v3
with:
path: public/
deploy_pages:
needs: zola
if: github.ref_name == 'redesign'
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-24.04
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4