2024-02-24 22:48:10 +02:00
|
|
|
name: Build and deploy site
|
2024-04-04 18:43:37 +03:00
|
|
|
|
2024-10-06 22:54:11 +03:00
|
|
|
on: [push, workflow_dispatch]
|
2024-04-04 18:43:37 +03:00
|
|
|
|
2024-02-24 22:48:10 +02:00
|
|
|
env:
|
|
|
|
GOROOT: /usr/local/lib/go
|
2024-04-04 18:43:37 +03:00
|
|
|
|
2024-01-27 22:42:55 +02:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
pages: write
|
|
|
|
id-token: write
|
2024-04-04 18:43:37 +03:00
|
|
|
|
2024-01-27 22:42:55 +02:00
|
|
|
jobs:
|
|
|
|
build:
|
2024-02-24 22:48:10 +02:00
|
|
|
name: Build site
|
2024-01-27 23:12:40 +02:00
|
|
|
runs-on: ubuntu-latest
|
2024-04-04 18:43:37 +03:00
|
|
|
container:
|
2024-01-27 23:12:40 +02:00
|
|
|
image: docker://git.korhonen.cc/functionalhacker/hugo-asciidoc-docker-ci:latest
|
2024-04-04 18:43:37 +03:00
|
|
|
|
2024-01-27 22:42:55 +02:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
2024-04-04 18:43:37 +03:00
|
|
|
|
2024-02-24 22:59:01 +02:00
|
|
|
- name: Fix git ownership
|
|
|
|
run: git config --global --add safe.directory /__w/korhonen.cc/korhonen.cc
|
2024-04-04 18:43:37 +03:00
|
|
|
|
2024-02-24 22:48:10 +02:00
|
|
|
- name: Install NPM packages
|
|
|
|
run: npm install
|
2024-04-04 18:43:37 +03:00
|
|
|
|
2024-02-24 22:48:10 +02:00
|
|
|
- name: Run Hugo
|
|
|
|
run: hugo --gc --minify -d /public
|
2024-04-04 18:43:37 +03:00
|
|
|
|
2024-02-24 22:48:10 +02:00
|
|
|
- name: Upload artifact
|
|
|
|
uses: actions/upload-pages-artifact@v3
|
|
|
|
with:
|
|
|
|
path: /public
|
2024-01-27 22:42:55 +02:00
|
|
|
|
2024-04-04 18:43:37 +03:00
|
|
|
deploy:
|
2024-02-24 23:01:18 +02:00
|
|
|
name: Deploy site to GitHub Pages
|
2024-01-27 22:42:55 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: build
|
2024-04-04 18:43:37 +03:00
|
|
|
|
|
|
|
environment:
|
|
|
|
name: github-pages
|
|
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
|
|
|
2024-01-27 22:42:55 +02:00
|
|
|
steps:
|
2024-02-24 23:01:18 +02:00
|
|
|
- name: Deploy site to GitHub Pages
|
2024-01-27 22:42:55 +02:00
|
|
|
id: deployment
|
2024-02-24 22:48:10 +02:00
|
|
|
uses: actions/deploy-pages@v4
|