Skip to content

Extract script

Extract script #18

#
# 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:
workflow_dispatch:
inputs:
downstream-version:
required: false
type: string
workflow_call:
inputs:
downstream-version:
required: false
type: string
push:
branches:
- docs/docusaurus-publishing
jobs:
publish-docusaurus:
permissions:
contents: write
packages: write
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: "Extract version"
id: extract_version
run: |
if [ -z ${{ inputs.downstream-version }} ]; then
echo "DOWNSTREAM_VERSION=$(grep "version" gradle.properties | awk -F= '{print $2}')" >> "$GITHUB_OUTPUT"
else
echo "DOWNSTREAM_VERSION=${{ inputs.downstream-version }}" >> "$GITHUB_OUTPUT"
fi
- name: "Gather documentation files"
run: |
chmod +x ./resources/create_kit_documentation.sh
./resources/create_kit_documentation.sh ${{ runner.temp }} $(pwd) ${{ env.DOWNSTREAM_VERSION }}
- name: Publish zip to GitHub Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ runner.temp }}/tractusx-edc-docusaurus-${{ env.DOWNSTREAM_VERSION }}.zip
tag: ${{ steps.extract_version.outputs.DOWNSTREAM_VERSION }}