Skip to content

Presentation flow with mdoc #161

Presentation flow with mdoc

Presentation flow with mdoc #161

Workflow file for this run

# HTML and CSS linting
# - stylelint: CSS/SCSS linting
# - HTMLHint: HTML linting
# Runs only when CSS or HTML files are touched
name: Lint HTML & CSS
on:
push:
branches: ["**"]
paths:
- "**/*.css"
- "**/*.html"
- ".htmlhintrc"
- ".stylelintrc.json"
- ".github/workflows/lint-html-css.yml"
pull_request:
branches: ["**"]
paths:
- "**/*.css"
- "**/*.html"
- ".htmlhintrc"
- ".stylelintrc.json"
- ".github/workflows/lint-html-css.yml"
jobs:
skip_check:
name: Skip duplicate runs
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip.outputs.should_skip }}
steps:
- id: skip
uses: fkirc/skip-duplicate-actions@v5
with:
concurrent_skipping: "same_content_newer"
skip_after_successful_duplicate: "true"
do_not_skip: '["workflow_dispatch", "schedule", "merge_group"]'
changes:
needs: skip_check
if: needs.skip_check.outputs.should_skip != 'true'
name: Detect changes
runs-on: ubuntu-latest
outputs:
css: ${{ steps.filter.outputs.css }}
html: ${{ steps.filter.outputs.html }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
css:
- "**/*.css"
- ".stylelintrc.json"
html:
- "**/*.html"
- ".htmlhintrc"
css:
needs: changes
if: needs.changes.outputs.css == 'true'
name: CSS (stylelint)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Run stylelint
run: npx stylelint 'app/static/**/*.css' --max-warnings 0
html:
needs: changes
if: needs.changes.outputs.html == 'true'
name: HTML (HTMLHint)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Run HTMLHint
run: npx htmlhint "app/templates/**/*.html" "app/static/**/*.html"