2020-03-13 02:50:44 -05:00
|
|
|
name: build
|
2020-03-13 01:11:51 -05:00
|
|
|
|
2021-07-06 11:49:42 -05:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
|
2022-12-12 09:33:38 -06:00
|
|
|
jobs:
|
2022-12-12 14:52:50 -06:00
|
|
|
build:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
name: checkout nosqlbench
|
|
|
|
- uses: actions/setup-java@v3
|
|
|
|
name: setup java
|
|
|
|
with:
|
|
|
|
java-version: '17'
|
|
|
|
java-package: jdk
|
|
|
|
architecture: x64
|
|
|
|
distribution: 'temurin'
|
|
|
|
|
|
|
|
- name: Cache Maven packages
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ~/.m2
|
|
|
|
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
|
|
|
|
restore-keys: ${{ runner.os }}-m2
|
|
|
|
|
|
|
|
- name: mvn package
|
|
|
|
run: mvn package
|
|
|
|
|
|
|
|
- name: export docs
|
|
|
|
run: nb5/target/nb5 export-docs
|
|
|
|
|
|
|
|
- name: archive docs
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: exported-docs
|
|
|
|
path: exported_docs.zip
|
|
|
|
|
|
|
|
# - name: mvn verify
|
|
|
|
# run: mvn verify
|
|
|
|
|
|
|
|
# - name: Archive Test Results
|
|
|
|
# if: always()
|
|
|
|
# uses: actions/upload-artifact@v3
|
|
|
|
# with:
|
|
|
|
# name: test-results
|
|
|
|
# path: |
|
|
|
|
# [a-zA-Z]**/logs/*
|
2022-12-06 14:54:22 -06:00
|
|
|
|
|
|
|
|
|
|
|
docs:
|
2022-12-12 14:52:50 -06:00
|
|
|
needs: build
|
2022-12-06 14:54:22 -06:00
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
|
|
- name: set git username
|
|
|
|
run: git config --global user.email "${{ secrets.NBDROID_EMAIL }}"
|
|
|
|
|
|
|
|
- name: set git email
|
|
|
|
run: git config --global user.name "${{ secrets.NBDROID_NAME }}"
|
|
|
|
|
2022-12-12 14:52:50 -06:00
|
|
|
- name: download exported-docs
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
name: exported-docs
|
|
|
|
|
|
|
|
- name: unzip docs
|
|
|
|
run: unzip exported_docs.zip
|
2022-12-06 14:54:22 -06:00
|
|
|
|
|
|
|
- run: ls -la
|
|
|
|
|
|
|
|
# - name: download docs
|
|
|
|
# uses: actions/download-artifact@v1
|
|
|
|
# with:
|
|
|
|
# name: guidebook
|
|
|
|
# path: guidebook
|
|
|
|
|
|
|
|
- name: clone nosqlbench-build-docs
|
|
|
|
env:
|
|
|
|
NBDROID_NAME: ${{ secrets.NBDROID_NAME }}
|
|
|
|
NBDROID_TOKEN: ${{ secrets.NBDROID_TOKEN }}
|
|
|
|
run: |
|
|
|
|
git clone https://${{secrets.NBDROID_NAME}}:${{secrets.NBDROID_TOKEN}}@github.com/nosqlbench/nosqlbench-build-docs.git nosqlbench-build-docs
|
|
|
|
cd nosqlbench-build-docs
|
|
|
|
echo "files listing"
|
|
|
|
find .
|
2022-12-12 14:18:11 -06:00
|
|
|
git remote set-url origin https://${{secrets.NBDROID_NAME}}:${{secrets.NBDROID_TOKEN}}@github.com/nosqlbench/nosqlbench-build-docs.git
|
2022-12-06 14:54:22 -06:00
|
|
|
git remote -v
|
|
|
|
|
2022-12-12 14:52:50 -06:00
|
|
|
# Disabling this because it will be replaced soon.
|
2022-12-06 14:54:22 -06:00
|
|
|
- name: push changes
|
|
|
|
env:
|
|
|
|
NBDROID_NAME: ${{ secrets.NBDROID_NAME }}
|
|
|
|
NBDROID_TOKEN: ${{ secrets.NBDROID_TOKEN }}
|
|
|
|
run: |
|
2022-12-14 12:26:18 -06:00
|
|
|
rsync -av --delete -I --exclude '_index.md' drivers/ nosqlbench-build-docs/site/content/docs/drivers
|
|
|
|
rsync -av --delete -I --exclude '_index.md' bindings/ nosqlbench-build-docs/site/content/docs/bindings
|
2022-12-16 13:26:17 -06:00
|
|
|
echo "previewdocs.nosqlbench.io" > nosqlbench-build-docs/site/staticCNAME
|
2022-12-12 09:36:35 -06:00
|
|
|
cd nosqlbench-build-docs
|
2022-12-16 11:26:51 -06:00
|
|
|
git add -A
|
2022-12-12 14:52:50 -06:00
|
|
|
CHANGES=$(git status --porcelain 2>/dev/null| wc -l)
|
|
|
|
echo "found $CHANGES to push for doc updates"
|
|
|
|
if (( $CHANGES > 0 ))
|
|
|
|
then
|
|
|
|
git commit -m"docs update for $GITHUB_REF"
|
|
|
|
git push
|
|
|
|
fi
|
2022-12-08 15:22:30 -06:00
|
|
|
echo "push completed"
|