Skip to content

github pages

github pages #290

Workflow file for this run

name: github pages
on:
workflow_dispatch:
inputs:
commit_sha:
description: 'Triggering SHA'
required: true
default: "$GITHUB_SHA"
push:
branches:
- main
schedule:
- cron: '0 5 * * *'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: dangeroustech/dangeroustech-blog
token: ${{ secrets.REPO_PAT }}
submodules: true # Fetch Hugo themes
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.145.0'
extended: true
- name: Clean public directory
run: rm -rf public
- name: Build
run: hugo --minify --theme PaperMod
- name: Create cname file
run: echo 'dangerous.tech' > public/CNAME
- name: Create Google Adsense file
run: echo 'google.com, pub-3139375174722237, DIRECT, f08c47fec0942fa0' > public/ads.txt
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
- name: Version
uses: go-semantic-release/action@v1
id: semrel
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
force-bump-patch-version: false
changelog-generator-opt: "emojis=true"
changelog-file: true