Skip to content

Build and Deploy site #51

Build and Deploy site

Build and Deploy site #51

Workflow file for this run

name: Build and Deploy site
on:
workflow_dispatch:
# Make the website deployment manual
# push:
# branches:
# - main
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Install jq
run: sudo apt-get update && sudo apt-get install -y jq
- name: Set HUGO_VERSION as env variable
run: echo "HUGO_VERSION=$(jq -r '.build.env.HUGO_VERSION' vercel.json)" >> $GITHUB_ENV
- name: Install Hugo
run: |
wget https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb
sudo dpkg -i hugo_extended_${HUGO_VERSION}_linux-amd64.deb
- name: Build site
run: hugo
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: ./public