Skip to content

deploy: d9999eb2a88debb763cb508e57b36bd2043b86bd #59

deploy: d9999eb2a88debb763cb508e57b36bd2043b86bd

deploy: d9999eb2a88debb763cb508e57b36bd2043b86bd #59

name: create documentation PR
on:
workflow_dispatch:
inputs:
version_tag:
description: |
The branch or tag name when generaing the QMDs. Also used for the name of the PR.
The name of the current branch or tag is used by default
type: string
push:
tags:
- '*'
jobs:
list:
runs-on: ubuntu-latest
outputs:
component_matrix: ${{ steps.set_matrix.outputs.components }}
workflow_matrix: ${{ steps.set_matrix.outputs.workflows }}
steps:
- uses: actions/checkout@v4
- uses: viash-io/viash-actions/setup@v5
- id: ns_list_components
uses: viash-io/viash-actions/ns-list@v5
with:
platform: docker
format: json
query_namespace: ^(?!workflows)
- id: ns_list_workflows
uses: viash-io/viash-actions/ns-list@v5
with:
format: json
query_namespace: ^workflows
- id: set_matrix
run: |
echo "components=$(jq -c '[ .[] |
{
"name": .functionality.name,
"namespace_separator": .platforms | map(select(.type == "docker"))[0].namespace_separator,
"namespace": .functionality.namespace,
"config": .info.config,
"dir": .info.config | capture("^(?<dir>.*\/)").dir
}
]' ${{ steps.ns_list_components.outputs.output_file }} )" >> $GITHUB_OUTPUT
echo "workflows=$(jq -c '[ .[] |
{
"name": $config.functionality.name,
"namespace": $config.functionality.namespace,
"main_script": ((.info.config | capture("^(?<dir>.*\/)").dir) + "/" + (.functionality.test_resources | map(select(.type == "nextflow_script")) | unique | .[].path )),
"config": .info.config,
"entry": .functionality.test_resources | map(select(.type == "nextflow_script")) | .[].entrypoint
}
]' ${{ steps.ns_list_workflows.outputs.output_file }} )" >> $GITHUB_OUTPUT
push_documentation:
runs-on: ubuntu-latest
needs: [ list ]
steps:
- uses: actions/checkout@v4
with:
path: openpipelines
- uses: actions/checkout@v4
with:
repository: openpipelines-bio/website
path: website
token: ${{ secrets.GTHB_PAT }}
- uses: viash-io/viash-actions/setup@v5
- name: Get tag to use
id: get_tag
run: |
INPUT_TAG="${{ github.event.inputs.version_tag }}"
TAG_OR_BRANCH_NAME=${INPUT_TAG:-"${{ github.ref_name }}"}
echo "tag=$TAG_OR_BRANCH_NAME" >> $GITHUB_OUTPUT
- uses: viash-io/viash-actions/pro/generate-documentation-qmd@v5
with:
project_directory: openpipelines
src: ./
output_dir: ../website/components/
dest_path: "{type}s/{namespace}/{name}.qmd"
viash_pro_token: ${{ secrets.GTHB_PAT }}
tools_version: main_build
ref: "${{ steps.get_tag.outputs.tag }}"
- name: Create Pull Request
env:
GITHUB_TOKEN: ${{ secrets.GTHB_PAT }}
working-directory: website
run: |
git config user.name github-actions
git config user.email [email protected]
git add .
git checkout -B "release-${{ steps.get_tag.outputs.tag }}"
git commit -m "OpenPipelines release ${{ steps.get_tag.outputs.tag }}"
git push --set-upstream origin "release-${{ steps.get_tag.outputs.tag }}"
gh pr create --title "Openpipeline release ${{ steps.get_tag.outputs.tag }}" --base main --head "release-${{ steps.get_tag.outputs.tag }}" --body ""