Skip to content

update

update #237

# Workflow for building and deploying an Eleventy site to GitHub Pages
name: Deploy Eleventy site to GitHub Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
# 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: 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
env:
NODE_VERSION: "22"
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
- name: Cache Eleventy incremental build state
uses: actions/cache@v4
with:
path: .cache
key: eleventy-build-${{ runner.os }}-${{ hashFiles('eleventy.config.js', 'package-lock.json') }}-${{ github.sha }}
restore-keys: |
eleventy-build-${{ runner.os }}-${{ hashFiles('eleventy.config.js', 'package-lock.json') }}-
- name: Cache processed images
uses: actions/cache@v4
with:
path: dist/img
key: eleventy-img-${{ runner.os }}-${{ hashFiles('src/_11ty/shortcodes.js') }}-${{ github.sha }}
restore-keys: |
eleventy-img-${{ runner.os }}-${{ hashFiles('src/_11ty/shortcodes.js') }}-
- name: Cache CSS build
uses: actions/cache@v4
with:
path: dist/styles
key: css-build-${{ runner.os }}-${{ hashFiles('postcss.config.js') }}-${{ github.sha }}
restore-keys: |
css-build-${{ runner.os }}-${{ hashFiles('postcss.config.js') }}-
- name: Install dependencies
run: npm ci
- name: Build site
run: npm run build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
force_orphan: true
cname: recipe.polente.de