Skip to content

Commit 2e4225a

Browse files
committed
make workflows match template
1 parent 703110d commit 2e4225a

9 files changed

+68
-222
lines changed

.github/workflows/delete-preview.yaml

-26
This file was deleted.

.github/workflows/deploy-book.yaml

-43
This file was deleted.

.github/workflows/deploy-preview.yaml

-137
This file was deleted.

.github/workflows/nightly-build.yaml

+3-6
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,12 @@ on:
77

88
jobs:
99
build:
10+
if: ${{ github.repository_owner == 'ProjectPythiaCookbooks' }}
1011
uses: ProjectPythiaCookbooks/cookbook-actions/.github/workflows/build-book.yaml@main
1112
with:
1213
environment_name: cookbook-dev
13-
environment_file: environment.yml
14-
path_to_notebooks: ./
1514

1615
link-check:
16+
if: ${{ github.repository_owner == 'ProjectPythiaCookbooks' }}
1717
uses: ProjectPythiaCookbooks/cookbook-actions/.github/workflows/link-checker.yaml@main
18-
with:
19-
environment_name: cookbook-dev
20-
environment_file: environment.yml
21-
path_to_notebooks: ./
18+

.github/workflows/publish-book.yaml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: publish-book
2+
3+
on:
4+
# Trigger the workflow on push to main branch
5+
push:
6+
branches:
7+
- main
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
uses: ProjectPythiaCookbooks/cookbook-actions/.github/workflows/build-book.yaml@main
13+
with:
14+
environment_name: cookbook-dev
15+
16+
deploy:
17+
needs: build
18+
uses: ProjectPythiaCookbooks/cookbook-actions/.github/workflows/deploy-book.yaml@main
19+

.github/workflows/trigger-book-build.yaml

+2-10
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,5 @@ jobs:
77
uses: ProjectPythiaCookbooks/cookbook-actions/.github/workflows/build-book.yaml@main
88
with:
99
environment_name: cookbook-dev
10-
environment_file: environment.yml
11-
path_to_notebooks: ./
12-
use_cached_environment: 'true' # This is default, not strickly needed. Set to 'false' to always build a new environment
13-
link-check:
14-
uses: ProjectPythiaCookbooks/cookbook-actions/.github/workflows/link-checker.yaml@main
15-
with:
16-
environment_name: cookbook-dev
17-
environment_file: environment.yml
18-
path_to_notebooks: ./
19-
use_cached_environment: 'true'
10+
artifact_name: book-zip-${{ github.event.number }}
11+
# Other input options are possible, see ProjectPythiaCookbooks/cookbook-actions/.github/workflows/build-book.yaml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: trigger-delete-preview
2+
3+
on:
4+
pull_request_target:
5+
types: closed
6+
7+
jobs:
8+
delete:
9+
uses: ProjectPythiaCookbooks/cookbook-actions/.github/workflows/delete-preview.yaml@main
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: trigger-link-check
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
link-check:
7+
uses: ProjectPythiaCookbooks/cookbook-actions/.github/workflows/link-checker.yaml@main
8+
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: trigger-preview
2+
on:
3+
workflow_run:
4+
workflows:
5+
- trigger-book-build
6+
types:
7+
- requested
8+
- completed
9+
10+
jobs:
11+
find-pull-request:
12+
uses: ProjectPythiaCookbooks/cookbook-actions/.github/workflows/find-pull-request.yaml@main
13+
deploy-preview:
14+
needs: find-pull-request
15+
if: github.event.workflow_run.conclusion == 'success'
16+
uses: ProjectPythiaCookbooks/cookbook-actions/.github/workflows/deploy-book.yaml@main
17+
with:
18+
artifact_name: book-zip-${{ needs.find-pull-request.outputs.number }}
19+
destination_dir: _preview/${{ needs.find-pull-request.outputs.number }} # deploy to subdirectory labeled with PR number
20+
is_preview: 'true'
21+
22+
preview-comment:
23+
needs: find-pull-request
24+
uses: ProjectPythiaCookbooks/cookbook-actions/.github/workflows/preview-comment.yaml@main
25+
with:
26+
pull_request_number: ${{ needs.find-pull-request.outputs.number }}
27+
sha: ${{ needs.find-pull-request.outputs.sha }}

0 commit comments

Comments
 (0)