Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add repository dispatch step to automate deploy #49

Merged
merged 2 commits into from
Mar 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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