Skip to content

Develop

Develop #54

on:
push:
branches: [ main ]
pull_request:
types:
- opened
- reopened
- synchronize
- closed
name: Render and deploy to Netlify
jobs:
build-deploy:
runs-on: ubuntu-latest
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
NETLIFY_SITE_ID: 284ddce0-61dd-40b7-ab79-8b5ac77ed457
steps:
- uses: actions/checkout@v3
- name: Assemble alpha/toolbox.json
uses: mikefarah/yq@master
with:
cmd: yq -M -o=json '. *d load("alpha/src/toolbox.yaml")' _includes/toolbox.yaml > alpha/toolbox.json
- name: Assemble alpha/annotations.json
uses: mikefarah/yq@master
with:
cmd: yq -M -o=json alpha/src/annotations.yaml > alpha/annotations.json
- name: Install Quarto
uses: quarto-dev/quarto-actions/setup@v2
with:
tinytex: true
- name: Render Quarto Project
uses: quarto-dev/quarto-actions/render@v2
with:
to: html
- name: Deploy to Netlify 🚀
uses: data-intuitive/netlify-deploy-site@v1
if: github.event_name != 'pull_request'
with:
auth: ${{ secrets.NETLIFY_AUTH_TOKEN }}
site: ${{ env.NETLIFY_SITE_ID }}
dir: '_site'
prod: true
message: 'Deploy production ${{ github.ref }}'
- name: Deploy preview
id: deploy_preview
if: github.event_name == 'pull_request'
uses: data-intuitive/netlify-deploy-site@v1
with:
auth: ${{ secrets.NETLIFY_AUTH_TOKEN }}
site: ${{ env.NETLIFY_SITE_ID }}
dir: '_site'
alias: "${{ env.BRANCH_NAME }}"
message: 'Deploy prooduction ${{ github.ref }}'
- uses: thollander/actions-comment-pull-request@v2
if: github.event_name == 'pull_request'
with:
message: |
[![Deploy: success](https://img.shields.io/badge/Deploy-success-success)](${{ steps.deploy_preview.outputs.deploy-url }})
comment_tag: deploy_status
- uses: thollander/actions-comment-pull-request@v2
if: github.event_name == 'pull_request' && failure()
with:
message: |
[![Deploy: failure](https://img.shields.io/badge/Deploy-failure-critical)]${{ steps.deploy_preview.outputs.logs }})
comment_tag: deploy_status