Skip to content

Commit 1e04b80

Browse files
authored
fix: move std library assets into docs directory to fix GitHub Pages deployment (#7365)
## Description PR #7362 attempted to fix the std library documentation deployment but broke it completely - the site now shows a 404 error at https://fuellabs.github.io/sway/master/std/. The issue was that CSS and JavaScript assets (`static.files/`, `search.js`) were not being deployed, causing the documentation to be unusable even when HTML pages loaded. This fix: 1. Builds docs with `forc doc` 2. Moves `static.files/` and `search.js` into the `std/` directory 3. Updates HTML relative paths (removes `../` references) 4. Deploys the complete package to `master/std` ## Checklist - [ ] I have linked to any relevant issues. - [ ] I have commented my code, particularly in hard-to-understand areas. - [ ] I have updated the documentation where relevant (API docs, the reference, and the Sway book). - [ ] If my change requires substantial documentation changes, I have [requested support from the DevRel team](https://github.com/FuelLabs/devrel-requests/issues/new/choose) - [ ] I have added tests that prove my fix is effective or that my feature works. - [ ] I have added (or requested a maintainer to add) the necessary `Breaking*` or `New Feature` labels where relevant. - [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs Code Review Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md). - [ ] I have requested a review from the relevant team or maintainers.
1 parent ad08f2c commit 1e04b80

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

.github/workflows/gh-pages.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,20 @@ jobs:
5555
- name: Build Sway std library
5656
run: forc doc --path ./sway-lib-std
5757

58+
- name: Move assets into std directory
59+
run: |
60+
mv ./sway-lib-std/out/doc/static.files ./sway-lib-std/out/doc/std/
61+
mv ./sway-lib-std/out/doc/search.js ./sway-lib-std/out/doc/std/
62+
# Fix relative paths in HTML files
63+
find ./sway-lib-std/out/doc/std -name "*.html" -type f -exec sed -i 's|../static\.files/|static.files/|g' {} \;
64+
find ./sway-lib-std/out/doc/std -name "*.html" -type f -exec sed -i 's|../search\.js|search.js|g' {} \;
65+
5866
- name: Deploy master std
5967
uses: peaceiris/actions-gh-pages@v3
6068
with:
6169
github_token: ${{ secrets.GITHUB_TOKEN }}
6270
publish_dir: ./sway-lib-std/out/doc/std
63-
destination_dir: master
71+
destination_dir: master/std
6472
if: github.ref == 'refs/heads/master'
6573

6674
- name: Deploy master book
@@ -125,7 +133,7 @@ jobs:
125133
uses: peaceiris/actions-gh-pages@v3
126134
with:
127135
github_token: ${{ secrets.GITHUB_TOKEN }}
128-
publish_dir: ./sway-lib-std/out/doc/std
136+
publish_dir: ./sway-lib-std/out/doc
129137
destination_dir: ${{ steps.branch_name.outputs.BRANCH_NAME }}/std
130138
if: startsWith(github.ref, 'refs/tags')
131139

0 commit comments

Comments
 (0)