Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 2 additions & 17 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,35 +30,20 @@ jobs:
ref: asf-site
path: checked-out-pouchdb-site
fetch-depth: 0
- name: Set up SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.POUCHDB_WEBSITE_BUILD }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan github.com >> ~/.ssh/known_hosts
- name: Configure SSH for GitHub
run: |
echo "Host github.com
IdentityFile ~/.ssh/id_rsa
IdentitiesOnly yes" >> ~/.ssh/config
- name: Commit and push if changed
env:
POUCHDB_WEBSITE_BUILD: ${{ secrets.POUCHDB_WEBSITE_BUILD }}
run: |
cd checked-out-pouchdb-site

git remote set-url origin git@github.com:apache/pouchdb-site.git
git remote add deploy https://asf-ci-deploy:$POUCHDB_WEBSITE_BUILD@github.com/apache/pouchdb-site

echo "Git remotes:"
git remote -v

# git config url."https://asf-ci-deploy:$POUCHDB_WEBSITE_BUILD@github.com/".insteadOf "https://github.com/"
git config user.email ${{ github.actor }}@users.noreply.github.com
git config user.name ${{ github.actor }}

# Juuust in case
GIT_TRACE=1 GIT_CURL_VERBOSE=1 git checkout asf-site

git rm -rf . || true

cp -R ../docs/_site/. .
Expand All @@ -67,7 +52,7 @@ jobs:
echo "Committing changes…"
git add -A
git commit -m "Deploy site from ${GITHUB_REPOSITORY}@${GITHUB_SHA}"
GIT_TRACE=1 GIT_CURL_VERBOSE=1 git push origin asf-site --force
GIT_TRACE=1 GIT_CURL_VERBOSE=1 git push deploy asf-site --force
else
echo "No changes to commit"
fi
Loading