Make it run also in separate branches #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build documentation | |
on: | |
push: | |
workflow_dispatch: | |
env: | |
INSTANCE: 'Writerside/hi' | |
DOCKER_VERSION: '243.21565' | |
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: Define instance id and artifacts | |
id: define-ids | |
run: | | |
INSTANCE=${INSTANCE#*/} | |
INSTANCE_ID_UPPER=$(echo "$INSTANCE" | tr '[:lower:]' '[:upper:]') | |
ARTIFACT="starlasu-documentation-${INSTANCE_ID_UPPER}.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 }} | |
artifact: ${{ env.ARTIFACT }} | |
docker-version: ${{ env.DOCKER_VERSION }} | |
- name: Save artifact with build results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: docs | |
path: | | |
artifacts/${{ env.ARTIFACT }} | |
artifacts/report.json | |
artifacts/${{ env.ALGOLIA_ARTIFACT }} | |
retention-days: 7 |