mirror of
https://github.com/oSoWoSo/DistroHopper.git
synced 2026-06-14 17:36:40 +00:00
67 lines
1.5 KiB
YAML
67 lines
1.5 KiB
YAML
name: Build GitHub Pages from md files
|
|
on:
|
|
push:
|
|
paths:
|
|
- '*.md'
|
|
- 'docs/*.css'
|
|
- 'docs/*.js'
|
|
- .github/workflows/website.yml
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
|
|
concurrency:
|
|
group: "pages"
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
docs_changed: ${{ steps.diff.outputs.changed }}
|
|
steps:
|
|
- name: 🛎️ Checkout
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 2
|
|
|
|
- name: Setup Pages
|
|
uses: actions/configure-pages@v4
|
|
|
|
- name: Install Pandoc
|
|
run: sudo apt-get update && sudo apt-get install -y pandoc
|
|
|
|
- name: Make pages
|
|
run: |
|
|
mkdir -p docs
|
|
./web-create -b
|
|
|
|
- name: Check if docs changed
|
|
id: diff
|
|
run: |
|
|
if git diff --quiet HEAD~1 HEAD -- docs/; then
|
|
echo "changed=false" >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo "changed=true" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
|
|
- name: Upload artifact
|
|
if: steps.diff.outputs.changed == 'true'
|
|
uses: actions/upload-pages-artifact@v4
|
|
with:
|
|
path: 'docs/'
|
|
|
|
deploy:
|
|
needs: build
|
|
if: needs.build.outputs.docs_changed == 'true'
|
|
runs-on: ubuntu-latest
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
steps:
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v4
|