2929 container : makeappdev/uselatex:latest
3030 steps :
3131 - uses : actions/checkout@v4
32- with :
32+ with :
3333 fetch-depth : 0
3434
3535 - name : Configure Git safe directory with GITHUB_WORKSPACE
@@ -41,15 +41,34 @@ jobs:
4141 mkdir -p build && cd build
4242 cmake ..
4343 make
44-
44+
45+ - name : Upload artifact
46+ uses : actions/upload-artifact@v4
47+ with :
48+ name : build-artifact
49+ path : ./build/*.pdf
50+ - name : Comment on PR with artifact link
51+ if : ${{ github.event_name == 'pull_request' }}
52+ uses : actions/github-script@v6
53+ with :
54+ github-token : ${{ secrets.GITHUB_TOKEN }}
55+ script : |
56+ const pr_number = context.payload.pull_request.number
57+ const run_id = process.env.GITHUB_RUN_ID
58+ const run_url = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${run_id}`
59+ await github.rest.issues.createComment({
60+ owner: context.repo.owner,
61+ repo: context.repo.repo,
62+ issue_number: pr_number,
63+ body: `:robot: The artifacts from this build are available [here](${run_url}).`
64+ })
4565 - name : Prepare Deployment
4666 if : github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
4767 run : |
4868 mkdir -p export
4969 echo "# This branch is for deployment only" >> export/README.md
5070 cp build/*.pdf export
5171 cp build/git.id export
52-
5372 - name : Deploy
5473 if : github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
5574
0 commit comments