initial dif labs website #4
Workflow file for this run
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: Deploy Hugo Website to GitHub Pages | |
on: | |
push: | |
branches: | |
- main # Adjust to your default branch name | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout the repository | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
# Set up Hugo | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
hugo-version: 'latest' | |
# Install Node.js (Optional, if themes require npm dependencies) | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '22' | |
# Install dependencies (Optional, if your Hugo site uses npm packages) | |
- name: Install npm dependencies | |
run: | | |
cd labs/website | |
npm install | |
# Build the Hugo website | |
- name: Build Hugo Website | |
run: | | |
cd labs/website | |
hugo -d public # Builds the site into the `public` directory | |
# Deploy to GitHub Pages | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: labs/website/public |