Skip to content

Bump actions/checkout from 3 to 4 (#278) #34

Bump actions/checkout from 3 to 4 (#278)

Bump actions/checkout from 3 to 4 (#278) #34

Workflow file for this run

name: Build docs with Antora
on:
push:
branches:
- main
env:
SITE_DIR: 'stargate'
SUB_DIR: 'latest'
jobs:
build_site:
name: "Build site with Antora"
runs-on: [ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Java for gradle
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 11
- name: Switch antora.yml symlink
run: |
FILE=antora.yml
cd $GITHUB_WORKSPACE/docs-src/stargate-core
if [ -f "$FILE" ]; then
rm antora.yml;
echo "antora.yml removed"
fi
ln -s antora-stargate.yml antora.yml
cd $GITHUB_WORKSPACE/docs-src/stargate-develop
if [ -f "$FILE" ]; then
rm antora.yml;
echo "antora.yml removed"
fi
ln -s antora-stargate.yml antora.yml
- name: Setup gradle
uses: gradle/actions/setup-gradle@v4
- name: Execute gradle build to run antora
run: ./gradlew antora
- name: "Fix attachments"
run: |
sudo mv $GITHUB_WORKSPACE/build/$SITE_DIR/$SUB_DIR/develop/_attachments $GITHUB_WORKSPACE/build/$SITE_DIR/$SUB_DIR/develop/attachments
sudo sed -i 's/_attachments/attachments/g' $GITHUB_WORKSPACE/build/$SITE_DIR/$SUB_DIR/develop/api.html
ls -ltra $GITHUB_WORKSPACE/build/$SITE_DIR
grep attachment $GITHUB_WORKSPACE/build/$SITE_DIR/$SUB_DIR/develop/api.html
- name: Upload generated site
uses: actions/upload-artifact@v4
with:
name: site
path: "${{ github.workspace }}/build/${{ env.SITE_DIR }}"
deploy_site:
runs-on: [ubuntu-latest]
needs: [build_site]
name: "Deploy GitHub Pages"
steps:
- name: Setup Node.js for use with actions
uses: actions/setup-node@v4
with:
node-version: 16
- name: Checkout
uses: actions/checkout@v4
- name: Download generated site
uses: actions/download-artifact@v4
with:
name: site
path: "${{ github.workspace }}/${{ env.SITE_DIR }}"
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
# ACCESS_TOKEN: # optional
token: "${{ github.token}}"
folder: "${{ env.SITE_DIR }}"
branch: 'gh-pages'
commit-message: "[CI] Publish documentation for ${{ github.sha }}"