Skip to content

Commit

Permalink
adds pr gha
Browse files Browse the repository at this point in the history
  • Loading branch information
Nowosad committed Sep 22, 2024
1 parent 2d0eb62 commit b143ea5
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 2 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/main_new.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ on:
push:
branches:
[main]
pull_request:
name: Quarto Publish
jobs:
bookdown:
quarto:
name: GH-Pages
runs-on: ubuntu-latest
permissions:
Expand Down
64 changes: 64 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
on:
workflow_dispatch:
pull_request:
branches:
[main]
name: Quarto PR Publish
jobs:
bookdown:
name: GH-Pages
runs-on: ubuntu-latest
permissions:
contents: write
statuses: write
steps:
- uses: actions/checkout@v3
- uses: julia-actions/setup-julia@v2
- uses: julia-actions/cache@v2
- name: Set up custom Julia dependencies
run: |
using Pkg
Pkg.activate("quarto"; shared = true)
# TODO: QuartoNotebookRunner does not support execute-dir yet, but this PR does.
Pkg.add(url = "https://github.com/asinghvi17/QuartoNotebookRunner.jl", rev = "as/execute-dir")
Pkg.instantiate()
Pkg.activate(".")
Pkg.add([
# TODO: DimensionalData v0.28 is not compatible with Rasters latest version,
# and has Makie fixes that we need for the book, otherwise plotting errors out.
# These can be removed after Rasters.jl's new breaking version.
PackageSpec(url = "https://github.com/asinghvi17/Rasters.jl", rev = "as/dd28"),
PackageSpec(url = "https://github.com/rafaqz/DimensionalData.jl", rev = "main"),
])
shell: julia {0}
- uses: julia-actions/julia-buildpkg@v1

- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
env:
QUARTO_JULIA_PROJECT: "@quarto"

- 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@v2
env:
NETLIFY_SITE_ID: e18690e5-215e-4584-b0f1-963bc99a10d0
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
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

0 comments on commit b143ea5

Please sign in to comment.