Updated main tex and release workflow #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create a release and deploy the pdf to GitHub Pages | |
name: New Release | |
on: | |
push: | |
tags: | |
- v*.*.* | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./latex | |
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: | | |
publish: | |
runs-on: ubuntu-latest | |
needs: [build] | |
steps: | |
- name: Create build destination | |
run: | | |
mkdir public | |
cat > public/index.html <<EOL | |
<!doctype html> | |
<html> | |
<head> | |
<title>GitHub Pages deployed!</title> | |
</head> | |
<body> | |
<div style="position: absolute; left: 0; right: 0; bottom: 0; top: 0;"> | |
<iframe src="./main.pdf" width="100%" height="100%" frameborder="0"> | |
</iframe> | |
</div> | |
</body> | |
</html> | |
EOL | |
- 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 }} |