Skip to content

Commit

Permalink
WIP 332 Trigger publication workflow but disable by default
Browse files Browse the repository at this point in the history
  • Loading branch information
ascheman committed Aug 15, 2024
1 parent 82ef310 commit afe022a
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/generate-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 10 additions & 2 deletions .github/workflows/publish-site-to-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
uses: actions/deploy-pages@v4
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit afe022a

Please sign in to comment.