From 1797f5a3834d55c31d2bb823cda033d0a4b9c277 Mon Sep 17 00:00:00 2001 From: Joao Eduardo Luis Date: Sat, 30 Mar 2024 22:54:12 +0000 Subject: [PATCH] .github: update docs workflow Signed-off-by: Joao Eduardo Luis --- .github/workflows/update-docs.yaml | 43 ++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/update-docs.yaml diff --git a/.github/workflows/update-docs.yaml b/.github/workflows/update-docs.yaml new file mode 100644 index 0000000..2e3bc7f --- /dev/null +++ b/.github/workflows/update-docs.yaml @@ -0,0 +1,43 @@ +--- +name: Update Documentation + +on: + push: + paths: + - "docs/**" + + workflow_dispatch: + +jobs: + update-docs: + runs-on: self-hosted + steps: + - name: Prepare environment + env: + GITHUB_TOKEN: ${{ secrets.DOCS_DEPLOY_SECRET }} + run: | + mkdir -p ${HOME}/.ssh || true + echo -e "${GITHUB_KEY}\n" > ${HOME}/.ssh/github + cat <${HOME}/.ssh/config + Host github + Hostname github.com + IdentityFile ~/.ssh/github + User git + EOF + + - name: Update docs repository + run: | + git clone git@github:s3gw-tech/s3gw-docs.git docs.git || exit 1 + pushd docs.git || exit 1 + + git config user.name "s3gw.tech github bot" || exit 1 + git config user.email "bot@s3gw.tech" || 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 + git push || exit 1