Skip to content

Commit

Permalink
ci: allow doc builds from forks
Browse files Browse the repository at this point in the history
  • Loading branch information
abn authored and neersighted committed May 13, 2022
1 parent 141d9eb commit 754199e
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
name: "Documentation Preview"

on:
push:
paths-ignore:
- '**'
- '!docs/**'
- '!.github/workflows/docs.yml'
branches-ignore:
- main
- master
pull_request:
# allow repository maintainers to modify and test workflow
paths-ignore:
- "**"
- "!.github/workflows/docs.yml"
pull_request_target:
# enable runs for this workflow when labeled as documentation only
# prevent execution when the workflow itself is modified from a fork
types:
- labeled
paths-ignore:
- '**'
- '!docs/**'
- '!.github/workflows/docs.yml'
branches:
- '**'
- "**"
- "!docs/**"

jobs:
deploy-preview:
deploy:
name: Build & Deploy
runs-on: ubuntu-latest

if: |
(github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'Documentation'))
|| (github.event_name != 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)
steps:
- name: Checkout Website Source
uses: actions/checkout@v3
Expand All @@ -32,6 +32,7 @@ jobs:
uses: actions/checkout@v3
with:
path: poetry
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Python
uses: actions/setup-python@v2
Expand Down

0 comments on commit 754199e

Please sign in to comment.