-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
trigger "Generate Website" after "Generate README"
- Loading branch information
1 parent
2d1a3df
commit b3c3956
Showing
1 changed file
with
13 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,29 @@ | ||
name: Generate Website | ||
run-name: generate website from README. | ||
on: | ||
workflow_dispatch: | ||
push: | ||
paths: | ||
- 'README.md' | ||
workflow_run: | ||
workflows: ["Generate README"] | ||
types: | ||
- completed | ||
workflow_dispatch: # For manual triggering (optional) | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/main' | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} && github.ref == 'refs/heads/main' | ||
|
||
steps: | ||
- name: checkout | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
# Prepare the README for static generator | ||
- run: cp README.md website/content/_index.md | ||
- run: "sed -i '1i ---\\ntemplate: index.html\\n---\\n' website/content/_index.md" | ||
|
||
# Build and deploy to gh-pages branch | ||
- name: build_and_deploy | ||
uses: shalzz/[email protected] | ||
env: | ||
# Target branch | ||
PAGES_BRANCH: gh-pages | ||
# Provide personal access token | ||
# TOKEN: ${{ secrets.TOKEN }} | ||
# Or if publishing to the same repo, use the automatic token | ||
TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BUILD_DIR: './website' |