Skip to content

Commit

Permalink
Use a different GHA for website deployment
Browse files Browse the repository at this point in the history
Instead of using `gh-pages` branch for deployment of the website, use
direct deployment with GHA instead. This allows for decoupling of
building (rendering) the site and its deployment, so the workflow
becomes [quarto render -> upload artifact -> deploy artifact] instead of
[quarto publish gh-pages] that never worked inside a container.
  • Loading branch information
fasterius committed Oct 18, 2024
1 parent 5b3d2d3 commit f0aca4c
Showing 1 changed file with 28 additions and 9 deletions.
37 changes: 28 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Render and publish site
name: Build and deploy site

on:
workflow_dispatch:
Expand All @@ -7,20 +7,39 @@ on:
- main
- specky

concurrency:
group: pages
cancel-in-progress: true

jobs:
publish:

build:
runs-on: ubuntu-latest
container: ghcr.io/nbisweden/workshop-reproducible-research/publish:specky
permissions:
contents: write
steps:

- name: Checkout
uses: actions/checkout@v4

- name: Publish to GitHub Pages
uses: quarto-dev/quarto-actions/publish@v2
- name: Build website with Quarto
uses: quarto-dev/quarto-actions/render@v2

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
target: gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
path: 'docs/'

deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
pages: write
id-token: write
steps:

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit f0aca4c

Please sign in to comment.