Skip to content

Commit f7ba251

Browse files
authored
Add Github Actions workflow to build documentation (mongodb#993)
* Add workflow to build and check docs * Fix docs build warnings
1 parent cb0f067 commit f7ba251

File tree

4 files changed

+62
-6
lines changed

4 files changed

+62
-6
lines changed

.github/workflows/docs.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: "Docs"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "v*.*"
7+
- "master"
8+
- "feature/*"
9+
push:
10+
branches:
11+
- "v*.*"
12+
- "master"
13+
- "feature/*"
14+
15+
jobs:
16+
giza:
17+
name: "Build Docs"
18+
runs-on: "ubuntu-20.04"
19+
20+
steps:
21+
- name: "Checkout library"
22+
uses: "actions/checkout@v3"
23+
with:
24+
path: library
25+
fetch-depth: 2
26+
27+
- name: "Checkout docs"
28+
uses: "actions/checkout@v3"
29+
with:
30+
repository: mongodb/docs-php-library
31+
path: docs
32+
fetch-depth: 2
33+
34+
- name: "Setup python"
35+
uses: actions/setup-python@v4
36+
with:
37+
python-version: '2.7'
38+
39+
# The requirements file installs urllib3 with an incompatible version; we replace it with one that works
40+
- name: "Install giza"
41+
run: |
42+
pip install -r https://raw.githubusercontent.com/mongodb/docs-tools/master/giza/requirements.txt
43+
pip install urllib3==1.25.2
44+
45+
- name: "Sync documentation"
46+
run: "rsync -a library/docs/ docs/source/"
47+
48+
- name: "Run Giza"
49+
run: "giza make publish"
50+
working-directory: docs
51+
52+
- name: "Upload built documentation"
53+
uses: actions/upload-artifact@v3
54+
with:
55+
name: php-library-docs.tar.gz
56+
path: docs/build/public/master/php-library.tar.gz

docs/reference/bson.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ Overview
1414
--------
1515

1616
MongoDB stores data records as BSON documents. BSON is a binary representation
17-
of :term:`JSON` documents, though it contains more data types than JSON. For the
18-
BSON spec, see `bsonspec.org <https://bsonspec.org/>`_.
17+
of JSON documents, though it contains more data types than JSON. For the BSON
18+
spec, see `bsonspec.org <https://bsonspec.org/>`_.
1919

2020
By default, the |php-library| returns BSON documents as
2121
:phpclass:`MongoDB\\Model\\BSONDocument` objects and BSON arrays as
@@ -106,7 +106,7 @@ of the PHP class in a special property within the BSON document.
106106
When deserializing a PHP variable from BSON, the encoded class name of a
107107
:php:`Persistable <mongodb-bson-persistable>` object will override any class
108108
specified in the type map, but it will not override ``"array"`` and
109-
``"stdClass"`` or ``"object"``. This is discussed in the
109+
``"stdClass"`` or ``"object"``. This is discussed in the
110110
:php:`persistence specification <mongodb.persistence>` but it bears
111111
repeating.
112112

@@ -121,7 +121,7 @@ Consider the following class definition:
121121
private $id;
122122
private $name;
123123
private $createdAt;
124-
124+
125125
public function __construct($name)
126126
{
127127
$this->id = new MongoDB\BSON\ObjectId;

docs/reference/method/MongoDBChangeStream-current.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,4 @@ See Also
103103
- :ref:`Tailable Cursor Iteration <php-tailable-cursor>`
104104
- :manual:`Change Streams </changeStreams>` documentation in the MongoDB manual
105105
- :manual:`Change Events </reference/change-events/>` documentation in the
106-
MongoDB manual
106+
MongoDB manual

docs/reference/method/MongoDBChangeStream-key.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,4 @@ See Also
7373
- :phpmethod:`MongoDB\\Database::watch()`
7474
- :php:`Iterator::key() <iterator.key>`
7575
- :ref:`Tailable Cursor Iteration <php-tailable-cursor>`
76-
- :manual:`Change Streams </changeStreams>` documentation in the MongoDB manual
76+
- :manual:`Change Streams </changeStreams>` documentation in the MongoDB manual

0 commit comments

Comments
 (0)