retry action #318
This file contains hidden or 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
| name: Compile | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths-ignore: | |
| - '.github/*' | |
| - '.gitignore' | |
| - 'Dockerfile' | |
| workflow_dispatch: | |
| branches: [ main ] | |
| env: | |
| BASE: "https://zenodo.org/api/deposit/depositions" | |
| jobs: | |
| compile: | |
| name: Compile | |
| runs-on: ubuntu-22.04 | |
| if: ${{ github.event_name != 'push' || vars.BUILD_ALWAYS == 1 }} | |
| permissions: write-all | |
| steps: | |
| - name: ✴️️ Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: 🔖 Set tag | |
| id: meta | |
| run: x="${{ github.ref_name }}"; echo "tag=${x/main/latest}" >> $GITHUB_OUTPUT | |
| - name: Upload readme | |
| run: curl -F "file=@readme.txt" ${{ env.BASE }}/${{ vars.ZENODO_ID }}/files?access_token=${{ secrets.ZENODO_TOKEN }} | |
| - name: 🏗️ Compile | |
| uses: xu-cheng/latex-action@v3 | |
| with: | |
| root_file: main.tex | |
| extra_fonts: ./fonts/* | |
| latexmk_use_xelatex: true | |
| post_compile: make -j 4 terms && make -j 4 compile | |
| - name: 📦 Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dissertation | |
| path: main.pdf | |
| - name: 🎁 Draft release | |
| uses: ncipollo/release-action@v1.14.0 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| tag: ${{ steps.meta.outputs.tag }} | |
| draft: ${{ github.ref_name == 'main' }} | |
| artifacts: | | |
| main.pdf | |
| readme.txt | |
| allowUpdates: true | |
| removeArtifacts: true | |
| replacesArtifacts: true | |
| deploy: | |
| name: Share | |
| runs-on: ubuntu-22.04 | |
| needs: compile | |
| steps: | |
| - name: ✴️️ Checkout target | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GH_PAT }} | |
| repository: ${{ vars.OUTPUT_REPO }} | |
| ref: ${{ vars.OUTPUT_BRANCH }} | |
| - name: 😺 Setup git config | |
| run: | | |
| git config --global user.name "GitHub Actions" | |
| git config --global user.email "<>" | |
| - name: ⬇️ Download artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: dissertation | |
| path: ${{ vars.OUTPUT_PATH }} | |
| - name: 🙈 Rename output file | |
| run: mv ${{ vars.OUTPUT_PATH }}/main.pdf ${{ vars.OUTPUT_PATH }}/${{ vars.OUTPUT_FNAME }} | |
| - name: Update version | |
| run: (cd site && npm run release) | |
| - name: 🚀 Commit and push | |
| run: | | |
| export COMMIT_MESSAGE="Compiled dissertation from @${{ github.sha }}" | |
| git add . | |
| git commit -m "$COMMIT_MESSAGE" | |
| git push |