diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..ed39684 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,57 @@ +on: + pull_request: + push: + branches: main + +name: Publish + +jobs: + build-deploy: + runs-on: ubuntu-latest + + permissions: + contents: write + + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Install R + uses: r-lib/actions/setup-r@v2 + + - name: Set up Quarto + uses: quarto-dev/quarto-actions/setup@v2 + + - uses: prefix-dev/setup-pixi@v0 + + - name: Cache several folders + uses: actions/cache@v2 + with: + path: | + _freeze + .pixi + key: ${{ runner.os }} + + - name: Set up dependencies + run: pixi install -e dev + + - name: Render slides + run: pixi run render_slides + + - name: Deploy 🚀 + if: github.event_name != 'pull_request' + uses: JamesIves/github-pages-deploy-action@v4 + with: + folder: _site + branch: gh-pages + force: false + clean-exclude: pr-preview/ + + - name: Deploy preview + if: github.event_name == 'pull_request' + uses: rossjrw/pr-preview-action@v1 + with: + source-dir: _site + preview-branch: gh-pages + umbrella-dir: pr-preview + action: auto \ No newline at end of file