Skip to content

Commit

Permalink
Upload build pdfs as artifacts (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
dariusptrs authored Dec 19, 2024
1 parent 580d71a commit 612e12b
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
container: makeappdev/uselatex:latest
steps:
- uses: actions/checkout@v4
with:
with:
fetch-depth: 0

- name: Configure Git safe directory with GITHUB_WORKSPACE
Expand All @@ -41,15 +41,34 @@ jobs:
mkdir -p build && cd build
cmake ..
make
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: build-artifact
path: ./build/*.pdf
- name: Comment on PR with artifact link
if: ${{ github.event_name == 'pull_request' }}
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const pr_number = context.payload.pull_request.number
const run_id = process.env.GITHUB_RUN_ID
const run_url = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${run_id}`
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr_number,
body: `:robot: The artifacts from this build are available [here](${run_url}).`
})
- name: Prepare Deployment
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
run: |
mkdir -p export
echo "# This branch is for deployment only" >> export/README.md
cp build/*.pdf export
cp build/git.id export
- name: Deploy
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
uses: JamesIves/[email protected]
Expand Down

0 comments on commit 612e12b

Please sign in to comment.