-
Notifications
You must be signed in to change notification settings - Fork 1.5k
59 lines (50 loc) · 1.62 KB
/
Copy pathdocs.yml
File metadata and controls
59 lines (50 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: PouchDB Docs
on:
push:
branches: [master]
paths:
- '.github/actions/**'
- '.github/workflows/docs.yml'
- 'package.json'
- 'bin/**'
- 'docs/**'
jobs:
test-docs:
runs-on: ubuntu-22.04
steps:
- name: Checkout PouchDB repo
uses: actions/checkout@v4
with:
persist-credentials: false
- uses: ./.github/actions/install-node-package
with:
node-version: 24
- run: BUILD=1 npm run build-site
- name: Checkout pouchdb-site repo
uses: actions/checkout@v4
with:
repository: apache/pouchdb-site
ref: asf-site
path: checked-out-pouchdb-site
fetch-depth: 0
token: ${{ secrets.POUCHDB_WEBSITE_BUILD }}
- name: Commit and push if changed
env:
POUCHDB_WEBSITE_BUILD: ${{ secrets.POUCHDB_WEBSITE_BUILD }}
run: |
cd checked-out-pouchdb-site
# git remote add deploy https://asf-ci-deploy:$POUCHDB_WEBSITE_BUILD@github.com/apache/pouchdb-site
echo "Git remotes:"
git remote -v
git config user.email ${{ github.actor }}@users.noreply.github.com
git config user.name ${{ github.actor }}
git rm -rf . || true
cp -R ../docs/_site/. .
if [[ -n $(git status --porcelain) ]]; then
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
else
echo "No changes to commit"
fi