| name: Build Site (w/ Antora) |
| |
| on: |
| push: |
| branches: |
| - master |
| pull_request: |
| branches: |
| - master |
| |
| permissions: |
| contents: read |
| |
| jobs: |
| build: |
| name: build-local-no-push |
| runs-on: ubuntu-latest |
| env: |
| # to be shared among all steps of this job |
| BASELINE: 2.0.0-RC4 |
| PROJECT_ROOT_PATH: ${{ github.workspace }} |
| CI_SCRIPTS_PATH: ${{ github.workspace }}/scripts/ci |
| ANTORA_PLAYBOOKS_PATH: ${{ github.workspace }}/antora/playbooks |
| |
| # used for printing |
| TIMESTAMP: ${{ github.event.head_commit.timestamp }} |
| |
| # though equivalent, setting SHARED_VARS_FILE to ~/.env breaks the build, not sure why |
| # the tilde character appears to produce strange side-effects when used here |
| SHARED_VARS_FILE: /home/runner/.env |
| |
| steps: |
| - uses: actions/checkout@v4 |
| |
| - name: Set up JDK 21 |
| uses: actions/setup-java@v4 |
| with: |
| distribution: 'zulu' |
| java-version: 21 |
| |
| - name: Setup Script Environment |
| shell: bash |
| # we write the more tricky variables to the $SHARED_VARS_FILE using the full power of bash commands |
| # then we simply print all the (non-secret) variables as used by the build scripts to the console |
| run: | |
| echo REVISION=$BASELINE.$(date +%Y%m%d)-$(date +%H%M)-$(echo $GITHUB_SHA | cut -c1-8) > $SHARED_VARS_FILE |
| echo ============== ENV ================= |
| echo BASELINE \: $BASELINE |
| echo TIMESTAMP \: $TIMESTAMP |
| echo PROJECT_ROOT_PATH \: $PROJECT_ROOT_PATH |
| echo CI_SCRIPTS_PATH \: $CI_SCRIPTS_PATH |
| echo ANTORA_PLAYBOOKS_PATH \: $ANTORA_PLAYBOOKS_PATH |
| echo REVISION \: $REVISION |
| cat $SHARED_VARS_FILE |
| echo ====================================== |
| |
| |
| - name: Print Node Version |
| run: node --version |
| |
| - name: Install NVM |
| shell: bash |
| run: bash $CI_SCRIPTS_PATH/install-nvm.sh |
| |
| - name: Install Antora |
| shell: bash |
| working-directory: ${{ env.PROJECT_ROOT_PATH }} |
| # we install the 'node' modules into the project root under 'node_modules', |
| # because we have no privileges to install them globally with -g option |
| run: npm i @antora/cli@^3.1.1 @antora/site-generator-default@^3.1.1 asciidoctor-kroki |
| |
| - name: List Versions of installed NPM Packages |
| shell: bash |
| working-directory: ${{ env.PROJECT_ROOT_PATH }} |
| run: npm list |
| |
| - name: Setup Groovy |
| if: steps.revision.outputs.revision != 'skip' |
| run: | |
| sudo apt-get update |
| sudo apt-get -f install groovy |
| |
| - name: Print Groovy Version |
| if: steps.revision.outputs.revision != 'skip' |
| shell: bash |
| run: groovy --version |
| |
| - name: Build Apache Causeway Site |
| shell: bash |
| working-directory: ${{ env.PROJECT_ROOT_PATH }} |
| run: bash -x $CI_SCRIPTS_PATH/_build-site.sh $ANTORA_PLAYBOOKS_PATH/site.yml |
| env: |
| REVISION: ${{ steps.revision.outputs.revision }} |
| SKIP_PROJDOC_GENERATION: true |
| SKIP_EXAMPLES: true |
| SKIP_CONFIGS: true |
| SKIP_STALE_EXAMPLE_CHECK: true |