Skip to content

Update Documentation #16

Update Documentation

Update Documentation #16

Workflow file for this run

---
name: Update Documentation
on:
push:
paths:
- "docs/**"
workflow_dispatch:
jobs:
update-docs:
runs-on: self-hosted
steps:
- name: Prepare environment
env:
GITHUB_KEY: ${{ secrets.DOCS_DEPLOY_SECRET }}
run: |
rm -fr ${HOME}/.ssh || true
mkdir -p ${HOME}/.ssh || true
chmod 700 ${HOME}/.ssh || exit 1
cat <<EOF>${HOME}/.ssh/github
${GITHUB_KEY}
EOF
chmod 400 ${HOME}/.ssh/github
cat <<EOF>${HOME}/.ssh/config
Host github
Hostname github.com
IdentityFile ${HOME}/.ssh/github
User git
EOF
chmod 600 ${HOME}/.ssh/config
# export SSH_AUTH_SOCK=$(mktemp --dry-run)
# ssh-agent -a ${SSH_AUTH_SOCK} || exit 1
# ssh-add ~/.ssh/github
- name: debug
run: |
cat ~/.ssh/config
- name: Update docs repository
run: |
GIT_SSH_COMMAND="ssh -vvv" git clone github:s3gw-tech/s3gw-docs.git docs.git || exit 1
pushd docs.git || exit 1
echo "setting up git repo"
git config user.name "s3gw.tech github bot" || exit 1
git config user.email "[email protected]" || exit 1
pushd s3gw || exit 1
git remote update origin
git checkout origin/main
popd || exit 1
git add s3gw || exit 1
git commit -m "docs: update s3gw to current main" || exit 1
echo "push to repository"
git push || exit 1