Skip to content

Commit

Permalink
trigger "Generate Website" after "Generate README"
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinschmitt authored Oct 17, 2024
1 parent 2d1a3df commit b3c3956
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/update_website.yml
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'

0 comments on commit b3c3956

Please sign in to comment.