Skip to content

Commit

Permalink
add repository dispatch step to automate deploy (#49)
Browse files Browse the repository at this point in the history
- add github-pages-deploy step in assets generator workflow

fix #35
  • Loading branch information
tobiasehlert authored Mar 2, 2024
1 parent 6e51fb3 commit 24287a6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ on:
jobs:
assets-generator:
runs-on: ubuntu-latest
outputs:
changed: ${{ steps.add-and-commit.outputs.committed }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -53,8 +55,17 @@ jobs:
working-directory: docs

- uses: EndBug/add-and-commit@v9
id: add-and-commit
with:
# The arguments for the `git add` command (see the paragraph below for more info)
add: "docs"
# The message for the commit
message: ".github/workflows/generate.yml: workflow generated JSON"

github-pages-deploy:
runs-on: ubuntu-latest
needs: assets-generator
if: needs.assets-generator.outputs.changed == 'true'
steps:
- name: Dispatch GitHub Pages deployment
uses: peter-evans/repository-dispatch@v3
with:
event-type: github-pages
2 changes: 2 additions & 0 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
- "main"
paths:
- "docs/**"
repository_dispatch:
types: [github-pages]
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
Expand Down

0 comments on commit 24287a6

Please sign in to comment.