Skip to content

Merge pull request #11 from nagar-ajay/update_install_instructions #11

Merge pull request #11 from nagar-ajay/update_install_instructions

Merge pull request #11 from nagar-ajay/update_install_instructions #11

name: hugo-build-deploy-on-push
on:
# Runs on pushes targeting the default branch
push:
branches: ["main", "release-v**"]
paths:
- website/**
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write
jobs:
# Build job
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: 0.105.0
extended: true
- name: Extract branch name
shell: bash
run: echo "VERSION_NAME=$(echo ${GITHUB_REF#refs/heads/} | sed 's/release//;s/-//' | sed 's/main/dev/' | sed 's/v1.7/./')" >> $GITHUB_OUTPUT
id: extract_branch
- name: Run a multi-line script
run: |
cd $GITHUB_WORKSPACE/website
npm install [email protected]
hugo
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./website/public
destination_dir: ${{ steps.extract_branch.outputs.version_name }}
keep_files: true