Skip to content

better submodule handling #16

better submodule handling

better submodule handling #16

Workflow file for this run

name: Publish wiki
on:
workflow_dispatch:
push:
branches:
- "documentation/1584-actions-to-wiki"
jobs:
generatewiki:
name: Generate WIKI
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'true'
- name: Set up GO
uses: actions/setup-go@v3
with:
go-version: 1.23
- name: Cache go modules
id: cache-go
uses: actions/cache@v3
env:
cache-name: dependency-cache-1.23
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Generate wiki
run: |
make genwiki PARAM=--verbose
- name: Publish if any changes
env:
GIT_USER_EMAIL: ${{ secrets.PERBOT_EMAIL }}
GIT_USER_NAME: ${{ secrets.PERBOT_USERNAME }}
run: |
git status
cd gopherciser.wiki
if [[ "$(git diff --name-only)" != "" ]]; then
git status
echo "publishing wiki"
set -e
git config user.email "$GIT_USER_EMAIL"
git config user.name "$GIT_USER_NAME"
git commit -a -m "Github action automatically generated wiki"
git push
else
echo "no changes skipping publish"
fi
- name: Update submodule and generated go file in branch
env:
GIT_USER_EMAIL: ${{ secrets.PERBOT_EMAIL }}
GIT_USER_NAME: ${{ secrets.PERBOT_USERNAME }}
run: |
pwd
git status
if [[ "$(git diff --name-only)" != "" ]]; then
echo "add generated documentation and wiki sha to branch"
set -e
git config user.email "$GIT_USER_EMAIL"
git config user.name "$GIT_USER_NAME"
git add generatedocs/generated/documentation.go
git add gopherciser.wiki
git status
#TODO push
else
echo "nothing to add"
fi