-
-
Notifications
You must be signed in to change notification settings - Fork 73
Update CI to use GitHub actions #426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+128
−136
Merged
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
c2882b4
add gh action for build docs
LiamConnors b1c1009
install python
LiamConnors b5b9b0f
Update build.yml
LiamConnors ab04ac8
Update 2020-08-21-dash_apps.md
LiamConnors 56a3a32
remove layout from dash_apps redirect
LiamConnors cec65a4
Delete 2020-08-21-dash_apps.md
LiamConnors 61bc86d
update file order
LiamConnors 85e4ee3
Update build.yml
LiamConnors 5e09140
Update build.yml
LiamConnors 2a8af0e
update build workflow
LiamConnors 921aa81
Update config.yml
LiamConnors 6df84a7
Update build.yml
LiamConnors 0551989
rename files
LiamConnors 0d9451d
fix redirects
LiamConnors 0bde408
add snapshots
LiamConnors 6ead7db
add mapbox and fetch upstream docs
LiamConnors b3e02ee
Update build.yml
LiamConnors c4a242e
use uv
LiamConnors 68aa1ca
Update build.yml
LiamConnors ac4f72b
Update build.yml
LiamConnors 0c98440
Update build.yml
LiamConnors 9f129c4
Update build.yml
LiamConnors c7cc8e2
Update 2020-08-21-dash_apps.md
LiamConnors 4100266
Update build.yml
LiamConnors 85f4901
Update build.yml
LiamConnors c86a1ed
Update build.yml
LiamConnors ea83d7e
Update build.yml
LiamConnors 9e319c7
Update build.yml
LiamConnors 3469cd1
Update build.yml
LiamConnors 81834e0
Revert "Update build.yml"
LiamConnors 65eb813
Merge branch 'master' into update-ci
LiamConnors 47f1e75
remove workarounds
LiamConnors fd271ea
Update build.yml
LiamConnors a4b9196
update branches and remove circleci
LiamConnors dc45d92
Apply suggestion from @LiamConnors
LiamConnors 32b74e9
Apply suggestion from @LiamConnors
LiamConnors 7829e3e
Update .github/workflows/build.yml
LiamConnors File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,121 @@ | ||
| name: Build and Deploy | ||
|
|
||
| on: | ||
| push: | ||
| branches-ignore: | ||
| - gh-pages | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Set up Ruby | ||
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: '2.7' | ||
| bundler-cache: true | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.12' | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v5 | ||
|
|
||
| - name: Install Python dependencies | ||
| run: uv pip install --system PyYAML==6.0.1 python-frontmatter==0.5.0 | ||
|
|
||
| - name: Fetch upstream docs | ||
| run: make fetch_upstream_files | ||
|
|
||
| - name: Set up Mapbox token | ||
| run: | | ||
| echo "token: ${{ secrets.MAPBOX_TOKEN }}" > _data/mapbox_token.yml | ||
|
|
||
| - name: Build site | ||
| run: | | ||
| python front-matter-ci.py _posts | ||
| python check-or-enforce-order.py _posts/python | ||
| python check-or-enforce-order.py _posts/python-v3 | ||
| python check-or-enforce-order.py _posts/r/ | ||
| python check-or-enforce-order.py _posts/matlab | ||
| python check-or-enforce-order.py _posts/plotly_js | ||
| python generate-sitemaps.py | ||
| md5sum all_static/css/main.css | cut -d ' ' -f 1 > _data/cache_bust_css.yml | ||
| bundle exec jekyll build | ||
| cp python/sitemap.xml _site/python/sitemap.xml | ||
| rm _data/mapbox_token.yml | ||
|
|
||
| - name: Create Percy snapshots | ||
| run: | | ||
| mkdir snapshots | ||
| cd _site | ||
| cp -r 'all_static' '../snapshots' | ||
| cp 'api/index.html' '../snapshots' | ||
| cp --parents 'python/index.html' '../snapshots' | ||
| cp --parents 'python/getting-started/index.html' '../snapshots' | ||
| cp --parents 'python/plotly-fundamentals/index.html' '../snapshots' | ||
| cp --parents 'python/line-and-scatter/index.html' '../snapshots' | ||
| cp --parents 'r/index.html' '../snapshots' | ||
| cp --parents 'r/getting-started/index.html' '../snapshots' | ||
| cp --parents 'r/plotly-fundamentals/index.html' '../snapshots' | ||
| cp --parents 'r/line-and-scatter/index.html' '../snapshots' | ||
| cp --parents 'javascript/index.html' '../snapshots' | ||
| cp --parents 'javascript/plotly-fundamentals/index.html' '../snapshots' | ||
| cp --parents 'javascript/getting-started/index.html' '../snapshots' | ||
| cp --parents 'javascript/line-and-scatter/index.html' '../snapshots' | ||
| cp --parents 'ggplot2/index.html' '../snapshots' | ||
| cp --parents 'ggplot2/getting-started/index.html' '../snapshots' | ||
| cp --parents 'ggplot2/histograms/index.html' '../snapshots' | ||
| cp --parents 'matlab/index.html' '../snapshots' | ||
| cp --parents 'matlab/getting-started/index.html' '../snapshots' | ||
| cp --parents 'matlab/graphing-multiple-chart-types/index.html' '../snapshots' | ||
| cp --parents 'matlab/histograms/index.html' '../snapshots' | ||
| cp --parents 'csharp/index.html' '../snapshots' | ||
| cp --parents 'csharp/getting-started/index.html' '../snapshots' | ||
| cd .. | ||
| rm -f 'snapshots/all_static/javascripts/jquery-knob/index.html' | ||
| rm -f 'snapshots/all_static/images/Plotly-feed2.html' | ||
| rm -f 'snapshots/all_static/images/Plotly.html' | ||
| rm -f 'snapshots/all_static/images/Plotly-Feed.html' | ||
| rm -f snapshots/*.bkp snapshots/*/*.bkp snapshots/*/*/*.bkp | ||
|
|
||
| - name: Percy snapshot | ||
| run: bundle exec percy snapshot snapshots --enable_javascript | ||
| env: | ||
| PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }} | ||
|
|
||
| - name: Create GitHub App token | ||
| if: github.ref_name == github.event.repository.default_branch && github.repository == 'plotly/graphing-library-docs' | ||
| uses: actions/create-github-app-token@v2 | ||
| id: app-token | ||
| with: | ||
| app-id: ${{ vars.GRAPHING_LIBRARIES_CI_GHAPP_ID }} | ||
| private-key: ${{ secrets.GRAPHING_LIBRARIES_CI_GHAPP_PRIVATE_KEY }} | ||
| owner: ${{ github.repository_owner }} | ||
| repositories: documentation | ||
|
|
||
| - name: Checkout documentation repo | ||
| if: github.ref_name == 'master' && github.repository == 'plotly/graphing-library-docs' | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: plotly/documentation | ||
| ref: gh-pages | ||
| token: ${{ steps.app-token.outputs.token }} | ||
| path: documentation | ||
|
|
||
| - name: Deploy docs | ||
| if: github.ref_name == 'master' && github.repository == 'plotly/graphing-library-docs' | ||
| run: | | ||
| git config --global user.email "accounts@plot.ly" | ||
| git config --global user.name "plotlydocbot" | ||
| cp -r _site/* documentation/ | ||
| cd documentation | ||
| git add . | ||
| git commit -m "deploying https://github.com/plotly/graphing-library-docs/commit/${{ github.sha }}" || echo "No changes to commit" | ||
| git push | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -359,4 +359,4 @@ var data = [{ | |
| cmin: 0, | ||
| cmax: 100 | ||
| }]; | ||
| ``` | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine as is, but why make it a separate step?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I felt it was cleaner and easier to read to keep all these setup steps separate