fix docs to only run on main branch and not forks

This commit is contained in:
titus
2026-02-09 12:30:07 -06:00
parent fcc5481477
commit 94d45a30fa

View File

@@ -1,37 +1,29 @@
# Sample workflow for building and deploying a Hugo site to GitHub Pages
name: Deploy Hugo site to Pages name: Deploy Hugo site to Pages
on: on:
# Runs on pushes targeting the default branch
push: push:
branches: branches:
- main - main
paths: paths:
- "docs/**" # ONLY triggers if files in the 'docs' folder are changed - "docs/**"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch: workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions: permissions:
contents: read contents: read
pages: write pages: write
id-token: write id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency: concurrency:
group: "pages" group: "pages"
cancel-in-progress: false cancel-in-progress: false
# Default to bash
defaults: defaults:
run: run:
shell: bash shell: bash
jobs: jobs:
# Build job
build: build:
if: github.repository == 'ChrisTitusTech/winutil'
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
HUGO_VERSION: 0.147.7 HUGO_VERSION: 0.147.7
@@ -81,6 +73,7 @@ jobs:
path: ./docs/public path: ./docs/public
deploy: deploy:
if: github.repository == 'ChrisTitusTech/winutil'
environment: environment:
name: github-pages name: github-pages
url: ${{ steps.deployment.outputs.page_url }} url: ${{ steps.deployment.outputs.page_url }}