Skip to content

Commit 612e12b

Browse files
authored
Upload build pdfs as artifacts (#7)
1 parent 580d71a commit 612e12b

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

.github/workflows/ci.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
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
uses: JamesIves/[email protected]

0 commit comments

Comments
 (0)