Skip to content

Commit 9feaddf

Browse files
Update CI to use GitHub actions (#426)
* add gh action for build docs * install python * Update build.yml * Update 2020-08-21-dash_apps.md * remove layout from dash_apps redirect * Delete 2020-08-21-dash_apps.md * update file order * Update build.yml * Update build.yml * update build workflow * Update config.yml * Update build.yml * rename files * fix redirects * add snapshots * add mapbox and fetch upstream docs * Update build.yml * use uv * Update build.yml * Update build.yml * Update build.yml * Update build.yml * Update 2020-08-21-dash_apps.md * Update build.yml * Update build.yml * Update build.yml * Update build.yml * Update build.yml * Update build.yml * Revert "Update build.yml" This reverts commit 3469cd1. * remove workarounds * Update build.yml * update branches and remove circleci * Apply suggestion from @LiamConnors * Apply suggestion from @LiamConnors * Update .github/workflows/build.yml Co-authored-by: Cameron DeCoster <cameron.decoster@gmail.com> --------- Co-authored-by: Cameron DeCoster <cameron.decoster@gmail.com>
1 parent 10110e2 commit 9feaddf

File tree

5 files changed

+128
-136
lines changed

5 files changed

+128
-136
lines changed

.circleci/config.yml

Lines changed: 0 additions & 129 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
name: Build and Deploy
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- gh-pages
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v6
15+
16+
- name: Set up Ruby
17+
uses: ruby/setup-ruby@v1
18+
with:
19+
ruby-version: '2.7'
20+
bundler-cache: true
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: '3.12'
26+
27+
- name: Install uv
28+
uses: astral-sh/setup-uv@v5
29+
30+
- name: Install Python dependencies
31+
run: uv pip install --system PyYAML==6.0.1 python-frontmatter==0.5.0
32+
33+
- name: Fetch upstream docs
34+
run: make fetch_upstream_files
35+
36+
- name: Set up Mapbox token
37+
run: |
38+
echo "token: ${{ secrets.MAPBOX_TOKEN }}" > _data/mapbox_token.yml
39+
40+
- name: Build site
41+
run: |
42+
python front-matter-ci.py _posts
43+
python check-or-enforce-order.py _posts/python
44+
python check-or-enforce-order.py _posts/python-v3
45+
python check-or-enforce-order.py _posts/r/
46+
python check-or-enforce-order.py _posts/matlab
47+
python check-or-enforce-order.py _posts/plotly_js
48+
python generate-sitemaps.py
49+
md5sum all_static/css/main.css | cut -d ' ' -f 1 > _data/cache_bust_css.yml
50+
bundle exec jekyll build
51+
cp python/sitemap.xml _site/python/sitemap.xml
52+
rm _data/mapbox_token.yml
53+
54+
- name: Create Percy snapshots
55+
run: |
56+
mkdir snapshots
57+
cd _site
58+
cp -r 'all_static' '../snapshots'
59+
cp 'api/index.html' '../snapshots'
60+
cp --parents 'python/index.html' '../snapshots'
61+
cp --parents 'python/getting-started/index.html' '../snapshots'
62+
cp --parents 'python/plotly-fundamentals/index.html' '../snapshots'
63+
cp --parents 'python/line-and-scatter/index.html' '../snapshots'
64+
cp --parents 'r/index.html' '../snapshots'
65+
cp --parents 'r/getting-started/index.html' '../snapshots'
66+
cp --parents 'r/plotly-fundamentals/index.html' '../snapshots'
67+
cp --parents 'r/line-and-scatter/index.html' '../snapshots'
68+
cp --parents 'javascript/index.html' '../snapshots'
69+
cp --parents 'javascript/plotly-fundamentals/index.html' '../snapshots'
70+
cp --parents 'javascript/getting-started/index.html' '../snapshots'
71+
cp --parents 'javascript/line-and-scatter/index.html' '../snapshots'
72+
cp --parents 'ggplot2/index.html' '../snapshots'
73+
cp --parents 'ggplot2/getting-started/index.html' '../snapshots'
74+
cp --parents 'ggplot2/histograms/index.html' '../snapshots'
75+
cp --parents 'matlab/index.html' '../snapshots'
76+
cp --parents 'matlab/getting-started/index.html' '../snapshots'
77+
cp --parents 'matlab/graphing-multiple-chart-types/index.html' '../snapshots'
78+
cp --parents 'matlab/histograms/index.html' '../snapshots'
79+
cp --parents 'csharp/index.html' '../snapshots'
80+
cp --parents 'csharp/getting-started/index.html' '../snapshots'
81+
cd ..
82+
rm -f 'snapshots/all_static/javascripts/jquery-knob/index.html'
83+
rm -f 'snapshots/all_static/images/Plotly-feed2.html'
84+
rm -f 'snapshots/all_static/images/Plotly.html'
85+
rm -f 'snapshots/all_static/images/Plotly-Feed.html'
86+
rm -f snapshots/*.bkp snapshots/*/*.bkp snapshots/*/*/*.bkp
87+
88+
- name: Percy snapshot
89+
run: bundle exec percy snapshot snapshots --enable_javascript
90+
env:
91+
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
92+
93+
- name: Create GitHub App token
94+
if: github.ref_name == github.event.repository.default_branch && github.repository == 'plotly/graphing-library-docs'
95+
uses: actions/create-github-app-token@v2
96+
id: app-token
97+
with:
98+
app-id: ${{ vars.GRAPHING_LIBRARIES_CI_GHAPP_ID }}
99+
private-key: ${{ secrets.GRAPHING_LIBRARIES_CI_GHAPP_PRIVATE_KEY }}
100+
owner: ${{ github.repository_owner }}
101+
repositories: documentation
102+
103+
- name: Checkout documentation repo
104+
if: github.ref_name == 'master' && github.repository == 'plotly/graphing-library-docs'
105+
uses: actions/checkout@v4
106+
with:
107+
repository: plotly/documentation
108+
ref: gh-pages
109+
token: ${{ steps.app-token.outputs.token }}
110+
path: documentation
111+
112+
- name: Deploy docs
113+
if: github.ref_name == 'master' && github.repository == 'plotly/graphing-library-docs'
114+
run: |
115+
git config --global user.email "accounts@plot.ly"
116+
git config --global user.name "plotlydocbot"
117+
cp -r _site/* documentation/
118+
cd documentation
119+
git add .
120+
git commit -m "deploying https://github.com/plotly/graphing-library-docs/commit/${{ github.sha }}" || echo "No changes to commit"
121+
git push

_posts/plotly_js/fundamentals/plotly-js-3-changes/2024-10-09-plotly-js-3-changes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,4 +359,4 @@ var data = [{
359359
cmin: 0,
360360
cmax: 100
361361
}];
362-
```
362+
```

_posts/plotly_js/fundamentals/static-image-export/2016-05-20-static-image.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ The common image formats: 'PNG', 'JPG/JPEG' are supported. In addition, formats
6868

6969
## Saving as SVG ##
7070
img_svg.attr("src", url);
71-
Plotly.toImage(gd,{format:'svg',height:800,width:800});
71+
Plotly.toImage(gd,{format:'svg',height:800,width:800});

makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ fetch_adjacent_python_files:
3737
cp -r ../plotly.py/doc/build/html _posts/python/html
3838

3939
fetch_upstream_files: clean
40-
git clone --depth 1 -b built git@github.com:plotly/plotly.py-docs _posts/python/html
41-
git clone --depth 1 -b built git@github.com:plotly/plotlyjs.jl-docs _posts/julia/html
42-
git clone --depth 1 -b built git@github.com:plotly/plotly.net-docs _posts/fsharp/html
43-
git clone --depth 1 -b built git@github.com:plotly/plotly.r-docs _posts/r/md
44-
git clone --depth 1 -b built git@github.com:plotly/plotly.matlab-docs _posts/matlab/md
40+
git clone --depth 1 -b built https://github.com/plotly/plotly.py-docs _posts/python/html
41+
git clone --depth 1 -b built https://github.com/plotly/plotlyjs.jl-docs _posts/julia/html
42+
git clone --depth 1 -b built https://github.com/plotly/plotly.net-docs _posts/fsharp/html
43+
git clone --depth 1 -b built https://github.com/plotly/plotly.r-docs _posts/r/md
44+
git clone --depth 1 -b built https://github.com/plotly/plotly.matlab-docs _posts/matlab/md
4545
mv _posts/r/md/ggplot2 _posts/ggplot2/md
4646
mv _posts/fsharp/html/csharp _posts/csharp/html
4747

0 commit comments

Comments
 (0)