From 8526ff63b1ed2b292316ff9cc7a66eb1f2b60e05 Mon Sep 17 00:00:00 2001 From: schuler-henry <72646334+schuler-henry@users.noreply.github.com> Date: Mon, 30 Jan 2023 19:41:11 +0100 Subject: [PATCH] Initial publish workflow. --- .github/workflows/new_release.yml | 71 +++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .github/workflows/new_release.yml diff --git a/.github/workflows/new_release.yml b/.github/workflows/new_release.yml new file mode 100644 index 0000000..9b37720 --- /dev/null +++ b/.github/workflows/new_release.yml @@ -0,0 +1,71 @@ +# create a release and deploy the pdf to GitHub Pages + +name: New Release + +on: + push: + tags: + - v*.*.* + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Set up Git repository + uses: actions/checkout@v3 + - name: Compile LaTeX document + uses: xu-cheng/latex-action@v2 + with: + root_file: "*.tex" + glob_root_file: true + - name: Upload PDF file + uses: actions/upload-artifact@v3 + with: + name: PDF + path: "*.pdf" + + release: + runs-on: ubuntu-latest + needs: [build] + + steps: + - name: Download build + uses: actions/download-artifact@v3 + with: + name: PDF + + - name: Create release + uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + prerelease: false + files: | + *.pdf + + publish: + runs-on: ubuntu-latest + needs: [build] + + steps: + - name: Create build destination + run: | + mkdir public + + - name: Download build + uses: actions/download-artifact@v3 + with: + name: PDF + path: public + + - name: View downloaded artifacts + run: ls -R + working-directory: public + + - name: Deploy to GitHub Pages + if: success() + uses: crazy-max/ghaction-github-pages@v3 + with: + target_branch: gh-pages + build_dir: public + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file