From afe022a940cac5c0743a64a422a99e1ebabd9a12 Mon Sep 17 00:00:00 2001 From: Gerd Aschemann Date: Thu, 15 Aug 2024 08:39:54 +0200 Subject: [PATCH] WIP 332 Trigger publication workflow but disable by default --- .github/workflows/generate-site.yml | 10 ++++++++++ .github/workflows/publish-site-to-gh-pages.yml | 12 ++++++++++-- ...sh-to-netlify.yml => publish-site-to-netlify.yml} | 11 ++++++++++- 3 files changed, 30 insertions(+), 3 deletions(-) rename .github/workflows/{publish-to-netlify.yml => publish-site-to-netlify.yml} (85%) diff --git a/.github/workflows/generate-site.yml b/.github/workflows/generate-site.yml index a53d3130..e022bce8 100644 --- a/.github/workflows/generate-site.yml +++ b/.github/workflows/generate-site.yml @@ -73,3 +73,13 @@ jobs: name: github-pages path: public retention-days: 7 + + - name: Trigger Publish to Netlify Workflow + uses: benc-uk/workflow-dispatch@v1 + with: + workflow: publish-site-to-netlify.yml + + - name: Trigger Publish to GitHub Pages Workflow + uses: benc-uk/workflow-dispatch@v1 + with: + workflow: publish-site-to-gh-pages.yml diff --git a/.github/workflows/publish-site-to-gh-pages.yml b/.github/workflows/publish-site-to-gh-pages.yml index 5abcf0b2..2b96d269 100644 --- a/.github/workflows/publish-site-to-gh-pages.yml +++ b/.github/workflows/publish-site-to-gh-pages.yml @@ -1,7 +1,14 @@ -name: Publish GitHub Pages +name: Publish Site to GitHub Pages on: + push: + pull_request: workflow_dispatch: + inputs: + publish_site: + type: boolean + description: 'Publish To GH Pages' + default: false jobs: publish-to-github: @@ -18,5 +25,6 @@ jobs: uses: actions/configure-pages@v5 - name: Deploy Pages + if: github.event.inputs.publish_site id: deployment - uses: actions/deploy-pages@v4 \ No newline at end of file + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/publish-to-netlify.yml b/.github/workflows/publish-site-to-netlify.yml similarity index 85% rename from .github/workflows/publish-to-netlify.yml rename to .github/workflows/publish-site-to-netlify.yml index 23ae6fa5..2694adc8 100644 --- a/.github/workflows/publish-to-netlify.yml +++ b/.github/workflows/publish-site-to-netlify.yml @@ -1,7 +1,14 @@ -name: Publish to Netlify +name: Publish Site to Netlify on: + push: + pull_request: workflow_dispatch: + inputs: + publish_site: + type: boolean + description: 'Publish To Netlify' + default: false jobs: publish-to-netlify: @@ -29,6 +36,7 @@ jobs: restore-keys: ${{ runner.os }}-netlify-cli - name: Deploy to Netlify + if: github.event.inputs.publish_site uses: South-Paw/action-netlify-cli@v2 id: netlify with: @@ -38,6 +46,7 @@ jobs: NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} - name: Get Netlify Preview URL + if: github.event.inputs.publish_site id: netlify-status run: | echo "NETLIFY_DEPLOY_URL=${{ fromJson(steps.netlify.outputs.NETLIFY_OUTPUT).deploy_url }}" >> $GITHUB_OUTPUT