Skip to content

Commit

Permalink
updadate
Browse files Browse the repository at this point in the history
  • Loading branch information
ftomassetti committed Jan 20, 2025
1 parent 0c0c20d commit 20765eb
Showing 1 changed file with 42 additions and 13 deletions.
55 changes: 42 additions & 13 deletions .github/workflows/build-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,49 @@ env:
jobs:
build:
runs-on: ubuntu-latest
outputs:
algolia_artifact: ${{ steps.define-ids.outputs.algolia_artifact }}
artifact: ${{ steps.define-ids.outputs.artifact }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Build documentation using Writerside Docker builder
- name: Define instance id and artifacts
id: define-ids
run: |
mkdir -p artifacts
docker run --rm \
-v "$PWD:/project" \
-w /project \
jetbrains/writerside-builder:${DOCKER_VERSION} \
/writerside/build.sh --input . --output artifacts
INSTANCE=${INSTANCE#*/}
INSTANCE_ID_UPPER=$(echo "$INSTANCE" | tr '[:lower:]' '[:upper:]')
ARTIFACT="webHelp${INSTANCE_ID_UPPER}2-all.zip"
ALGOLIA_ARTIFACT="algolia-indexes-${INSTANCE_ID_UPPER}.zip"
# Print the values
echo "INSTANCE_ID_UPPER: $INSTANCE_ID_UPPER"
echo "ARTIFACT: $ARTIFACT"
echo "ALGOLIA_ARTIFACT: $ALGOLIA_ARTIFACT"
# Set the environment variables and outputs
echo "INSTANCE_ID_UPPER=$INSTANCE_ID_UPPER" >> $GITHUB_ENV
echo "ARTIFACT=$ARTIFACT" >> $GITHUB_ENV
echo "ALGOLIA_ARTIFACT=$ALGOLIA_ARTIFACT" >> $GITHUB_ENV
echo "artifact=$ARTIFACT" >> $GITHUB_OUTPUT
echo "algolia_artifact=$ALGOLIA_ARTIFACT" >> $GITHUB_OUTPUT
- name: Build docs using Writerside Docker builder
uses: JetBrains/writerside-github-action@v4
with:
instance: ${{ env.INSTANCE }}
docker-version: ${{ env.DOCKER_VERSION }}

- name: Save artifact with build results
uses: actions/upload-artifact@v4
with:
name: docs
path: |
artifacts/${{ steps.define-ids.outputs.artifact }}
artifacts/report.json
artifacts/${{ steps.define-ids.outputs.algolia_artifact }}
retention-days: 7

- name: Upload build artifact
uses: actions/upload-artifact@v4
Expand All @@ -38,9 +67,9 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Create a release version tag
RELEASE_TAG="v$(date +'%Y%m%d%H%M%S')"
echo "Release tag: $RELEASE_TAG"
# Create a release version tag
RELEASE_TAG="v$(date +'%Y%m%d%H%M%S')"
echo "Release tag: $RELEASE_TAG"
# Package the built artifact and upload it to GitHub Packages
mkdir -p ./package
# Package the built artifact and upload it to GitHub Packages
mkdir -p ./package

0 comments on commit 20765eb

Please sign in to comment.