Skip to content

Branch Build Hugo - EN_github #127

Branch Build Hugo - EN_github

Branch Build Hugo - EN_github #127

name: Branch Build Hugo - EN_github
on:
workflow_dispatch:
push:
branches: [$default-branch]
paths:
- "!contents/**" # Exclude the contents folder
- "!github/**" # Exclude the .github folder
- "!git/**" # Exclude the .git folder
- "index.en.md"
- "bump.md"
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
defaults:
run:
shell: bash
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Set up Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: "0.113.0"
extended: true
- name: Print PWD
run: pwd
- name: Setup Pages
id: pages
uses: actions/configure-pages@v4
- name: Install Node.js dependencies
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
- name: Build Hugo site
uses: actions/cache@v3
with:
path: /tmp/hugo_cache
key: ${{ runner.os }}-hugomod-github
restore-keys: |
${{ runner.os }}-hugomod-en
- name: Build Hugo site
env:
# For maximum backward compatibility with Hugo modules
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: hugo --cleanDestinationDir -D -E -F --gc --minify --enableGitInfo --cacheDir /tmp/hugo_cache --config /home/runner/work/simeononsecurity.ch/simeononsecurity.ch/config/language/en/config_github.toml
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./public
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2