diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 7395183479..b1caf66e47 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -2,13 +2,6 @@ name: PouchDB Docs on: push: - paths: - - '.github/actions/**' - - '.github/workflows/docs.yml' - - 'package.json' - - 'bin/**' - - 'docs/**' - pull_request: branches: [master] paths: - '.github/actions/**' @@ -22,7 +15,7 @@ jobs: test-docs: runs-on: ubuntu-22.04 steps: - - name: Checkout + - name: Checkout PouchDB repo uses: actions/checkout@v4 with: persist-credentials: false @@ -30,10 +23,6 @@ jobs: with: node-version: 24 - run: BUILD=1 npm run build-site - - name: Setup SSH agent - uses: webfactory/ssh-agent@v0.9.0 - with: - ssh-private-key: ${{ secrets.POUCHDB_WEBSITE_BUILD }} - name: Checkout pouchdb-site repo uses: actions/checkout@v4 with: @@ -43,10 +32,13 @@ jobs: path: checked-out-pouchdb-site fetch-depth: 0 - name: Commit and push if changed + env: + POUCHDB_WEBSITE_BUILD: ${{ secrets.POUCHDB_WEBSITE_BUILD }} run: | cd checked-out-pouchdb-site - git config user.name "CI" - git config user.email "ci@users.noreply.github.com" + 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 checkout asf-site @@ -55,11 +47,13 @@ jobs: cp -R ../docs/_site/. . + git remote -v + if [[ -n $(git status --porcelain) ]]; then echo "Committing changes…" git add -A git commit -m "Deploy site from ${GITHUB_REPOSITORY}@${GITHUB_SHA}" - git push git@github.com:apache/pouchdb-site.git asf-site --force + git push origin asf-site --force else echo "No changes to commit" fi \ No newline at end of file