Skip to content

Build and Deploy Documentation #12

Build and Deploy Documentation

Build and Deploy Documentation #12

name: Build and Deploy Documentation
on:
push:
branches:
- main
workflow_dispatch:
env:
INSTANCE: 'Writerside/strumenta'
DOCKER_VERSION: '243.21565'
jobs:
build:
runs-on: ubuntu-latest
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"
# Set environment variables and outputs
echo "INSTANCE_ID_UPPER=$INSTANCE_ID_UPPER" >> $GITHUB_ENV
echo "ARTIFACT=$ARTIFACT" >> $GITHUB_ENV
echo "artifact=$ARTIFACT" >> $GITHUB_OUTPUT
- name: Build documentation using Writerside Docker builder
run: |
mkdir -p artifacts
docker run --rm \
-v "$PWD:/project" \
-w "/project" \
jetbrains/writerside-builder:${DOCKER_VERSION} \
build --instance "${INSTANCE}" --output "artifacts/${ARTIFACT}"
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: writerside-docs
path: artifacts/
- name: Push built documentation as a package
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"
# Package the built artifact and upload it to GitHub Packages
mkdir -p ./package