diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..6c23c01 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,71 @@ +name: Release PDFs + +on: + release: + types: [published] + workflow_dispatch: + +jobs: + convert-markdown-to-pdf: + runs-on: ubuntu-latest + + permissions: + contents: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Fetch tags + run: git fetch --tags + + - name: Get latest tag + id: get_tag + run: | + latest_tag=$(git describe --tags `git rev-list --tags --max-count=1` || true) + echo "Latest tag: $latest_tag" + echo "::set-output name=tag::$latest_tag" + + - name: Calculate new version + id: new_version + run: | + if [ -z "${{ steps.get_tag.outputs.tag }}" ]; then + # No tags found, set initial version + new_version="1.0.0" + else + # Parse the latest version + latest_version=${{ steps.get_tag.outputs.tag }} + IFS='.' read -r -a version_parts <<< "$latest_version" + major=${version_parts[0]} + minor=${version_parts[1]} + patch=${version_parts[2]} + # Increment the patch version + patch=$((patch+1)) + new_version="$major.$minor.$patch" + fi + echo "New version: $new_version" + echo "::set-output name=version::$new_version" + + - name: Create new tag + run: | + git tag ${{ steps.new_version.outputs.version }} + git push origin ${{ steps.new_version.outputs.version }} + + - name: Build PDFs + run: make + + - name: Install Hub CLI + run: sudo apt-get install -y hub + + - name: Upload PDFs to GitHub Releases + run: | + set -x + cd build + assets=() + for asset in ./*.pdf; do + assets+=("-a" "$asset") + done + tag_name="${{ steps.new_version.outputs.version }}" + hub release create "${assets[@]}" -m "$tag_name" "$tag_name" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f891527 --- /dev/null +++ b/Makefile @@ -0,0 +1,38 @@ +# Automatically generate PDF from READMEs + +BUILD_FOLDER ?= build + +PDFs = healthcare-ci-pipelines.pdf + +TARGETS = $(PDFs:%=$(BUILD_FOLDER)/%) + +all: $(TARGETS) + +# Step 0: Create build folder +$(BUILD_FOLDER): + mkdir -p $(BUILD_FOLDER) + +# Step 1: Convert mermaid graphs into pngs and generate README-out.md +README-out.md: README.md + docker run \ + -u $(shell id -u):$(shell id -g) \ + -v $(shell pwd):/data \ + -w /data/ \ + minlag/mermaid-cli \ + -i README.md -o README-out.md --outputFormat png \ + --scale 10 + +# Step 2: Generate PDFs from README-out.md using pandoc +$(BUILD_FOLDER)/%.pdf: $(BUILD_FOLDER) README-out.md + docker run \ + -u $(shell id -u):$(shell id -g) \ + -w /data/ \ + -v $(shell pwd):/data \ + ghcr.io/ethan42/pandoctex \ + pandoc README-out.md -f gfm -s \ + --pdf-engine=xelatex \ + -o "$(BUILD_FOLDER)/$*.pdf" \ + -V mainfont="Linux Libertine O" \ + -V monofont="Noto Mono" \ + -V fontsize=12pt \ + -V colorlinks=true -V linkcolor=darkgray -V urlcolor=blue -V toccolor=gray diff --git a/README.md b/README.md index 7284e01..2e2b8d0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,3 @@ -# 🚧 Repository Under Construction 🚧 - -This repository is currently under active development. Features and documentation may change frequently. Please check back later for updates! # Ready-To-Go Healthcare CI Pipelines @@ -8,7 +5,12 @@ This repository is currently under active development. Features and documentatio Healthcare CI Pipelines

-This project is an open-source collection of Continuous Integration (CI) pipelines designed to streamline the development of secure and compliant healthcare software. The project provides CI pipeline configurations that enforce current security best practices and compliance standards. Our goal is to enable rapid integration, testing, and delivery of software that meets stringent regulatory requirements while actually improving the security of the software stack. +This project is an open-source collection of Continuous Integration (CI) pipelines +designed to streamline the development of secure and compliant healthcare software. +The project provides CI pipeline configurations that enforce current security best +practices and compliance standards. Our goal is to enable rapid integration, testing, +and delivery of software that meets stringent regulatory requirements while actually +improving the security of the software stack. ## Salient Features @@ -22,7 +24,8 @@ This project is an open-source collection of Continuous Integration (CI) pipelin ## Integration -All pipelines within this repo implement standalone security checks that pass/fail and generate reports. The generic integration pattern looks as follows: +All pipelines within this repo implement standalone security checks that pass/fail +and generate reports. The generic integration pattern looks as follows: ```mermaid flowchart TB