Skip to content

Merge pull request #123 from saurabhraghuvanshii/build #22

Merge pull request #123 from saurabhraghuvanshii/build

Merge pull request #123 from saurabhraghuvanshii/build #22

Workflow file for this run

name: Build and Deploy to GitHub Pages
on:
push:
branches:
- master
paths-ignore:
- ".github/**"
pull_request:
branches:
- master
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
name: Build Hugo site
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Setup Hugo Extended
uses: peaceiris/actions-hugo@v3
with:
hugo-version: "0.158.0"
extended: true
- name: Install Node.js dependencies
run: npm ci
- name: Build Hugo site
run: |
hugo --minify \
--baseURL "https://${{ github.repository_owner }}.github.io/academy-example/"
- name: Upload Pages artifact
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
uses: actions/upload-pages-artifact@v3
with:
path: ./public
deploy:
name: Deploy to GitHub Pages
needs: build
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4