From b3c39566d3da96e134a3948b3685429434fce9a7 Mon Sep 17 00:00:00 2001 From: Marvin Schmitt <35921281+marvinschmitt@users.noreply.github.com> Date: Thu, 17 Oct 2024 18:45:29 +0200 Subject: [PATCH] trigger "Generate Website" after "Generate README" --- .github/workflows/update_website.yml | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/update_website.yml b/.github/workflows/update_website.yml index 161fd38..478a98f 100644 --- a/.github/workflows/update_website.yml +++ b/.github/workflows/update_website.yml @@ -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/zola-deploy-action@v0.17.2 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'