Skip to content

update_pkg_reference_manuals #955

update_pkg_reference_manuals

update_pkg_reference_manuals #955

# Add repos that are not in systempipeR organizations here
name: update_pkg_reference_manuals
on:
schedule:
- cron: "0 2 * * *"
jobs:
update_ref:
name: update_pkg_reference_manuals
runs-on: ubuntu-20.04
outputs:
pg_build: ${{ steps.update_gh.outputs.pg_build }}
steps:
- uses: actions/checkout@v2
- name: Update reference
run: |
bash .github/bash/update_reference.sh https://github.com/lz100/spsUtil.git static/sps/funcs/spsutil
bash .github/bash/update_reference.sh https://github.com/lz100/spsComps.git static/sps/funcs/spscomps
bash .github/bash/update_reference.sh https://github.com/lz100/drawer.git static/sps/funcs/drawer
- name: Update github
id: update_gh
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "there are changes, start to build page";
echo "::set-output name=pg_build::true"
git config --local user.name "Github Action Bot"
git config --local user.email "[email protected]"
git add -A
git commit -m "Bot update hash and copy files" -a
else
echo "no changes";
echo "::set-output name=pg_build::false"
fi
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
hugobuild:
name: build_and_push_to_gh_pages
needs: update_ref
if: needs.update_ref.outputs.pg_build == 'true'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: "recursive"
- run: git pull
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.79.1'
extended: true
- name: Cache node dependencies
uses: actions/cache@v2
with:
path: ~/.npm
key: node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
node-
- run: npm ci
- run: hugo --minify
- name: Update github
run: |
git config --local user.name "Github Action Bot"
git config --local user.email "[email protected]"
git add -A
git commit -m "Bot build site" -a
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
cname: systempipe.org