name: Draft PDF
on:
  push:
    branches:
      - main
    paths:
      - 'paper.md'
      - 'paper.bib'
  pull_request:
    paths:
      - 'paper.md'
      - 'paper.bib'
  workflow_dispatch:

jobs:
  paper:
    runs-on: ubuntu-latest
    name: Paper Draft
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        
      - name: Build draft PDF
        uses: openjournals/openjournals-draft-action@master
        with:
          journal: joss
          paper-path: paper.md
          
      - name: Upload PDF
        uses: actions/upload-artifact@v4
        with:
          name: paper
          path: paper.pdf
