diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..f9237e5 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,22 @@ +name: Build LaTeX document +on: + pull_request: + +jobs: + build_latex: + runs-on: ubuntu-latest + steps: + - name: Set up Git repository + uses: actions/checkout@v2 + - name: Compile LaTeX document + uses: xu-cheng/latex-action@v2 + with: + root_file: DynamicalBook.tex + working_directory: book + args: -pdf -latexoption=-file-line-error -latexoption=-interaction=nonstopmode -latexoption=-shell-escape + extra_system_packages: py-pygments + - name: Uploads the document + uses: actions/upload-artifact@v2 + with: + name: DynamicalBook + path: book/DynamicalBook.pdf diff --git a/.github/workflows/buildlatex.yml b/.github/workflows/deploy.yml similarity index 68% rename from .github/workflows/buildlatex.yml rename to .github/workflows/deploy.yml index 6768722..a09ef0e 100644 --- a/.github/workflows/buildlatex.yml +++ b/.github/workflows/deploy.yml @@ -1,5 +1,9 @@ name: Build LaTeX document -on: [push] +on: + push: + branches: + - master + jobs: build_latex: runs-on: ubuntu-latest @@ -7,12 +11,12 @@ jobs: - name: Set up Git repository uses: actions/checkout@v2 - name: Compile LaTeX document - uses: dante-ev/latex-action@latest + uses: xu-cheng/latex-action@v2 with: root_file: DynamicalBook.tex working_directory: book args: -pdf -latexoption=-file-line-error -latexoption=-interaction=nonstopmode -latexoption=-shell-escape - extra_system_packages: python-pygments + extra_system_packages: py-pygments - name: Uploads the document uses: actions/upload-artifact@v2 with: @@ -20,7 +24,8 @@ jobs: path: book/DynamicalBook.pdf - run: mkdir build - run: cp book/DynamicalBook.pdf build/ - - uses: maxheld83/ghpages@v0.3.0 - env: - BUILD_DIR: build/ - GH_PAT: ${{ secrets.GH_PAT }} + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./build