Build and Deploy site #49
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |