korhonen.cc/.github/workflows/deploy_site.yaml

40 lines
1 KiB
YAML
Raw Normal View History

2024-02-24 22:48:10 +02:00
name: Build and deploy site
2024-01-27 22:42:55 +02:00
on: [push]
2024-02-24 22:48:10 +02:00
env:
GOROOT: /usr/local/lib/go
2024-01-27 22:42:55 +02:00
permissions:
contents: read
pages: write
id-token: write
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
container:
image: docker://git.korhonen.cc/functionalhacker/hugo-asciidoc-docker-ci:latest
2024-02-24 22:48:10 +02:00
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
2024-01-27 22:42:55 +02:00
steps:
- name: Checkout
uses: actions/checkout@v4
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-02-24 22:48:10 +02:00
- name: Install NPM packages
run: npm install
- name: Run Hugo
run: hugo --gc --minify -d /public
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: /public
2024-01-27 22:42:55 +02:00
2024-02-24 22:48:10 +02: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
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