Skip to content

Commit

Permalink
Added MRI-CIA project form and the new workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
c-h-benedetti committed Aug 9, 2024
0 parents commit 005dc52
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/on-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Builds the documents on release

on:
release:
types: [created]

jobs:
convert_and_upload:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install LibreOffice
run: sudo apt-get update && sudo apt-get install -y libreoffice

- name: Convert ODT to PDF
run: |
find . -name "*.odt" -exec libreoffice --headless --convert-to pdf {} \;
- name: Upload PDF to release
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: |
$(find . -name "*.pdf" | tr '\n' ' ')
asset_name: |
$(find . -name "*.pdf" -exec basename {} \; | tr '\n' ' ')
asset_content_type: application/pdf

16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# MRI-CIA Documents

- The repository contains the documents relative to the MRI-CIA version.
- It allows to have a unique and constant link to the latest version of documents.
- Files can be "built" ('odt' to 'pdf', ...) from the GitHub actions of the repository.

## Add a new document, example with an ODT

- Add the '.odt' file into this repository.
- Modify the workflow (.github/workflows/on-release.yml) to "build" your document (ex: convert your '.odt' to '.pdf') on release.
- Make your modifications as you wish and push them.
- When you will make a new release, the PDF will be part of the assets.
- You can access the assets of your latest release with the URL: github.com/MontpellierRessourcesImagerie/mri-cia-documents/releases/latest/my-document.pdf


**Note:** The ODT to PDF conversion is already insured for any ODT document at the root of this repo, you don't need to edit the workflow.
Binary file added mri-cia-project-form.odt
Binary file not shown.

0 comments on commit 005dc52

Please sign in to comment.