www.netz39.de/.github/workflows/jekyll-gh-pages.yml

78 lines
2 KiB
YAML
Raw Normal View History

2023-10-23 13:36:59 +02:00
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
name: Deploy Jekyll with GitHub Pages dependencies preinstalled
2023-10-23 13:36:59 +02:00
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: read
# 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
jobs:
# Build job
build:
name: "Build GitHub Pages Site"
permissions:
contents: read
2023-10-23 13:36:59 +02:00
runs-on: ubuntu-latest
steps:
- name: Cached checkout
uses: nschloe/action-cached-lfs-checkout@v1
# Use these to explicitly include/exclude files:
# with:
# include: "*"
# exclude: ""
- name: Build the site in the jekyll/builder container
run: |
docker run \
-v ${{ github.workspace }}:/srv/jekyll -v ${{ github.workspace }}/_site:/srv/jekyll/_site \
jekyll/builder:latest /bin/bash -c "chmod -R 777 /srv/jekyll && jekyll build --future"
- name: Install packages
continue-on-error: true
run: |
docker pull sylhare/type-on-strap
docker pull sylhare/jekyll
- name: "Upload artifact"
2024-03-27 00:22:26 +01:00
uses: actions/upload-pages-artifact@v3
with:
path: _site/
2023-10-23 13:36:59 +02:00
# Deployment job
2023-10-23 13:36:59 +02:00
deploy:
name: "Deploy GitHub Pages Site"
if: github.event_name == 'push'
needs:
- build
permissions:
pages: write
id-token: write
2023-10-23 13:36:59 +02:00
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
2023-10-23 13:36:59 +02:00
runs-on: ubuntu-latest
steps:
- name: "Deploy to GitHub Pages"
2023-10-23 13:36:59 +02:00
id: deployment
2024-03-27 00:22:26 +01:00
uses: actions/deploy-pages@v4
with:
error_count: 0