From d90afe219baa8d39c77c0a2bd44c3658f1f655a6 Mon Sep 17 00:00:00 2001 From: Andy Teucher Date: Thu, 14 Nov 2024 13:54:40 -0800 Subject: [PATCH 1/2] Add deploy preview --- .github/workflows/deploy-preview.yml | 42 ++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/deploy-preview.yml diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml new file mode 100644 index 0000000..66398ae --- /dev/null +++ b/.github/workflows/deploy-preview.yml @@ -0,0 +1,42 @@ +on: + # workflow_dispatch allows deploy preview by pushing button on GitHub + workflow_dispatch: + pull_request: + branches: [main] + +name: Deploy Preview + +jobs: + build-deploy-preview: + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Set up Quarto + uses: quarto-dev/quarto-actions/setup@v2 + + - name: Render + uses: quarto-dev/quarto-actions/render@v2 + with: + to: html + + - name: Deploy Preview to Netlify as preview + id: netlify-deploy + uses: nwtgck/actions-netlify@v3 + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_SITE_ID: ba5ad61a-3dae-4e81-8b9a-de27c5e495f5 + with: + publish-dir: './_site' + production-deploy: false + github-token: ${{ secrets.GITHUB_TOKEN }} + deploy-message: + 'Deploy from GHA: ${{ github.event.pull_request.title || github.event.head_commit.message }} (${{ github.sha }})' + alias: deploy-preview-${{ github.event.number }} + # these all default to 'true' + enable-pull-request-comment: true + enable-commit-comment: false + enable-commit-status: true + overwrites-pull-request-comment: false + timeout-minutes: 1 From 39ea54ced4123f30b1d4859bace1a2620f321480 Mon Sep 17 00:00:00 2001 From: Andy Teucher Date: Thu, 14 Nov 2024 14:14:49 -0800 Subject: [PATCH 2/2] Update checkout to v4 --- .github/workflows/quarto-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/quarto-publish.yml b/.github/workflows/quarto-publish.yml index 41ba83e..df104d0 100644 --- a/.github/workflows/quarto-publish.yml +++ b/.github/workflows/quarto-publish.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Quarto uses: quarto-dev/quarto-actions/setup@v2