Skip to content

Commit

Permalink
Add publish workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
ethan42 committed Nov 20, 2024
1 parent 1154434 commit b7846fc
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 5 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -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 }}
38 changes: 38 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# 🚧 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

<p align="center">
<img src="img/logo.png" alt="Healthcare CI Pipelines" width="200" height="200">
</p>

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

Expand All @@ -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
Expand Down

0 comments on commit b7846fc

Please sign in to comment.