Skip to content
#
# Copyright (c) 2023 Mercedes Benz Tech Innovation GmbH
# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
---
name: "Publish docusaurus documentation"
on:
push:
branches:
- docs/docusaurus-publishing
workflow_dispatch:
inputs:
downstream-version:
required: false
type: string
workflow_call:
inputs:
downstream-version:
required: false
type: string
jobs:
publish-docusaurus:
name: "Publish docusaurus documentation as zip file"
runs-on: ubuntu-latest
env:
SWAGGERHUB_API_KEY: ${{ secrets.SWAGGERHUB_API_KEY }}
SWAGGERHUB_USER: ${{ secrets.SWAGGERHUB_USER }}
steps:
- uses: actions/checkout@v3
- name: "Setup node"
uses: actions/setup-node@v3
- name: "Install tools"
run: |
npm i -g swaggerhub-cli markdownlint-cli2 @synx-ai/oas3-mdx
- name: "Extract version"
run: |
downstream_version=${{ inputs.downstream-version }}
if [ -z $downstream_version ]; then
export DOWNSTREAM_VERSION=$(sed -nr "{ :l /^version[ ]*=/ { s/[^=]*=[ ]*//; p; q;}; n; b l;}" ./gradle.properties | tr -d ' ' | tr -d '"')
else
export DOWNSTREAM_VERSION=${{ inputs.downstream-version }}
fi
echo ${{ env.DOWNSTREAM_VERSION }}
- name: "Gather documentation files"
run: |
mkdir -p ${{ runner.temp }}/tractusx-edc/Connector\ Kit
rsync -a --prune-empty-dirs --exclude 'build' --include '*' ./docs/kit/* ${{ runner.temp }}/tractusx-edc/Connector\ Kit/
mkdir -p ${{ runner.temp }}/tractusx-edc/Connector\ Kit/Operation\ View/03_deployment_via_helm
cp ./docs/samples/example-dataspace/README.md ${{ runner.temp }}/tractusx-edc/Connector\ Kit/Operation\ View/03_deployment_via_helm/00_example_dataspace.md
cp ./docs/samples/edr-api-overview/edr-api-overview.md ${{ runner.temp }}/tractusx-edc/Connector\ Kit/Operation\ View/03_deployment_via_helm/01_edr_api_overview.md
mkdir -p ${{ runner.temp }}/tractusx-edc/Connector\ Kit/Operation\ View/04_Test\ Your\ Setup
cp ./docs/development/postman/README.md ${{ runner.temp }}/tractusx-edc/Connector\ Kit/Operation\ View/04_Test\ Your\ Setup/00_postman.md
cp ./docs/samples/Transfer\ Data.md ${{ runner.temp }}/tractusx-edc/Connector\ Kit/Operation\ View/04_Test\ Your\ Setup/02_transfer_data.md
cp -r ./docs/samples/diagrams ${{ runner.temp }}/tractusx-edc/Connector\ Kit/Operation\ View/04_Test\ Your\ Setup/
mkdir -p ${{ runner.temp }}/tractusx-edc/Connector\ Kit/Operation\ View/05_Migration
cp ./docs/migration/* ${{ runner.temp }}/tractusx-edc/Connector\ Kit/Operation\ View/05_Migration/
mkdir -p ${{ runner.temp }}/tractusx-edc/Connector\ Kit/Development\ View
cp ./docs/README.md ${{ runner.temp }}/tractusx-edc/Connector\ Kit/Development\ View/00_tractusx_edc.md
cp ./core/edr-core/README.md ${{ runner.temp }}/tractusx-edc/Connector\ Kit/Development\ View/06_edr_core.md
cp ./docs/development/Release.md ${{ runner.temp }}/tractusx-edc/Connector\ Kit/Development\ View/07_release.md
mkdir -p ${{ runner.temp }}/tractusx-edc/Connector\ Kit/Development\ View/03_EDC\ Controlplane
rsync -a --prune-empty-dirs --include '*/' --exclude 'build' --include '*.md' --include '*.png' --include '*.puml' --exclude '*' ./edc-controlplane/* ${{ runner.temp }}/tractusx-edc/Connector\ Kit/Development\ View/03_EDC\ Controlplane
mkdir -p ${{ runner.temp }}/tractusx-edc/Connector\ Kit/Development\ View/04_EDC\ Dataplane
rsync -a --prune-empty-dirs --include '*/' --exclude 'build' --include '*.md' --include '*.png' --include '*.puml' --exclude '*' ./edc-dataplane/* ${{ runner.temp }}/tractusx-edc/Connector\ Kit/Development\ View/04_EDC\ Dataplane
mkdir -p ${{ runner.temp }}/tractusx-edc/Connector\ Kit/Development\ View/05_EDC\ Extensions
rsync -a --prune-empty-dirs --include '*/' --exclude 'build' --include '*.md' --include '*.png' --include '*.puml' --exclude '*' ./edc-extensions/* ${{ runner.temp }}/tractusx-edc/Connector\ Kit/Development\ View/05_EDC\ Extensions
mkdir -p ${{ runner.temp }}/tractusx-edc/Connector\ Kit/Documentation
cp ./docs/development/coding-principles.md ${{ runner.temp }}/tractusx-edc/Connector\ Kit/Documentation/02_coding_principles.md
cp ./pr_etiquette.md ${{ runner.temp }}/tractusx-edc/Connector\ Kit/Documentation/03_pr_etiquette.md
cp ./styleguide.md ${{ runner.temp }}/tractusx-edc/Connector\ Kit/Documentation/04_styleguide.md
mkdir -p ${{ runner.temp }}/tractusx-edc/Connector\ Kit/Documentation/resources
cp ./resources/tx-checkstyle-config.xml ${{ runner.temp }}/tractusx-edc/Connector\ Kit/Documentation/resources
cp ./SECURITY.md ${{ runner.temp }}/tractusx-edc/Connector\ Kit/Documentation/05_security.md
mkdir -p ${{ runner.temp }}/tractusx-edc/Connector\ Kit/Documentation/resources
cp ./resources/save_actions_scr.png ${{ runner.temp }}/tractusx-edc/Connector\ Kit/Documentation/resources/
swaggerhub api:get ${{ env.SWAGGERHUB_USER }}/tractusx-edc/${{ env.DOWNSTREAM_VERSION }} > ${{ runner.temp }}/tractusx-edc/tractusx-edc-${{ env.DOWNSTREAM_VERSION }}.yaml
zip -r ${{ runner.temp }}/tractusx-edc-docusaurus.zip ${{ runner.temp }}/tractusx-edc
- name: Publish zip to GitHub Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
file: "${{ runner.temp }}/tractusx-edc-docusaurus.zip"
tag: "${{ env.DOWNSTREAM_VERSION }}"