Skip to content

docs update for refs/heads/main #73

docs update for refs/heads/main

docs update for refs/heads/main #73

Workflow file for this run

name: preview
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+-preview"
jobs:
sync-to-preview:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/master'
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 }}"
- run: ls -la
- 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 site
git remote set-url origin https://${{secrets.NBDROID_NAME}}:${{secrets.NBDROID_TOKEN}}@github.com/nosqlbench/nosqlbench-build-docs.git
git remote -v
- name: clone nosqlbench-preview-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-preview-docs.git nosqlbench-preview-docs
cd nosqlbench-preview-docs
echo "files listing"
find site
git remote set-url origin https://${{secrets.NBDROID_NAME}}:${{secrets.NBDROID_TOKEN}}@github.com/nosqlbench/nosqlbench-preview-docs.git
git remote -v
- name: 'Sync Build to Preview'
run: |
set -x
rsync -av --exclude='.git*' --delete nosqlbench-build-docs/ nosqlbench-preview-docs/
perl -pi -e 's/\(BUILD\)/\(PREVIEW\)/' nosqlbench-preview-docs/site/config.toml
perl -pi -e 's/\(build\)/\(preview\)/' nosqlbench-preview-docs/site/config.toml
perl -pi -e 's/builddocs/previewdocs/' nosqlbench-preview-docs/site/config.toml
perl -pi -e 's/builddocs/previewdocs/' nosqlbench-preview-docs/site/static/CNAME
- name: "commit imported changes"
env:
NBDROID_NAME: ${{ secrets.NBDROID_NAME }}
NBDROID_TOKEN: ${{ secrets.NBDROID_TOKEN }}
run: |
set -x
pwd
cd nosqlbench-preview-docs
git add site
git add -u
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