-
Notifications
You must be signed in to change notification settings - Fork 80
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
Confusing error when trying to deploy Rust docs #303
Comments
Can you point us at a workflow run maybe where you see this error? |
Yes. Thanks for reaching out, @yoannchaudet, and my apologies for not providing anything to work with. To make it up to you all, I put in some extra effort and made a minimal reproducible example at https://github.com/rikhuijzer/deploy-pages-mwe. The repository contains a minimal Rust project and attempts to deploy the docs via This is the full workflow, which should work for any simple Rust project: name: docs
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Stable Rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: 'stable'
- name: Build docs and manually add an index.html file
run: |
cargo doc --all --no-deps
echo '<meta http-equiv="refresh" content="0; url=mwe">' > target/doc/index.html
- uses: actions/upload-pages-artifact@v3
if: ${{ github.event_name != 'pull_request' }}
with:
path: './target/doc'
retention-days: '1'
deploy:
# Separate step to keep the permissions separated.
needs: build
if: ${{ github.event_name != 'pull_request' }}
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- id: deployment
uses: actions/deploy-pages@v4 This is the error:
In another repository, I could easily fix the error by switching to deploying the pages via a |
index.html
exists
And this is the file tree for the generated artifact: $ tree artifact/
artifact/
├── crates.js
├── help.html
├── index.html
├── mwe
│ ├── all.html
│ ├── fn.plus_one.html
│ ├── index.html
│ └── sidebar-items.js
├── search-index.js
├── settings.html
├── src
│ └── mwe
│ └── lib.rs.html
├── src-files.js
└── static.files
├── COPYRIGHT-23e9bde6c69aea69.txt
├── FiraSans-LICENSE-db4b642586e02d97.txt
├── FiraSans-Medium-8f9a781e4970d388.woff2
├── FiraSans-Regular-018c141bf0843ffd.woff2
├── LICENSE-APACHE-b91fa81cba47b86a.txt
├── LICENSE-MIT-65090b722b3f6c56.txt
├── NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2
├── NanumBarunGothic-LICENSE-18c5adf4b52b4041.txt
├── SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2
├── SourceCodePro-LICENSE-d180d465a756484a.txt
├── SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2
├── SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2
├── SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2
├── SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2
├── SourceSerif4-LICENSE-3bb119e13b1258b7.md
├── SourceSerif4-Regular-46f98efaafac5295.ttf.woff2
├── clipboard-7571035ce49a181d.svg
├── favicon-16x16-8b506e7a72182f1c.png
├── favicon-2c020d218678b618.svg
├── favicon-32x32-422f7d1d52889060.png
├── main-9dd44ab47b99a0fb.js
├── normalize-76eba96aa4d2e634.css
├── noscript-5d8b3c7633ad77ba.css
├── rust-logo-151179464ae7ed46.svg
├── rustdoc-9ee3a5e31a2afa3e.css
├── scrape-examples-ef1e698c1d417c0c.js
├── search-8fbf244ebcf71464.js
├── settings-74424d7eec62a23e.js
├── src-script-3280b574d94e47b4.js
├── storage-fec3eaa3851e447d.js
└── wheel-7b819b6101059cd0.svg
5 directories, 42 files I also manually confirmed via |
@rikhuijzer Thanks for spending the time to get some details! We do a bit more validation than the error message implies (will look into fixing that so it's clear what's going on). Here is what's tripping your deployment:
We talk about permissions and provide some ways to fix that in: https://github.com/actions/upload-pages-artifact?tab=readme-ov-file#file-permissions |
I hit this too; luckily I found this issue since the error message is not helpful. The simplest fix appears to be just to delete the rm target/doc/.lock |
I'm facing the same issue. How were you able to see this error? It could help me work out what's wrong with my deployment. all I see is: Run actions/deploy-pages@v4
Fetching artifact metadata for "github-pages" in this workflow run
Found 1 artifact(s)
Creating Pages deployment with payload:
{
"artifact_id": 14[9](https://github.com/TheDevelolper/notedrop/actions/runs/9050589086/job/24866183439#step:2:10)4693185,
"pages_build_version": "945bbcc148d4bc792a32188277b80d150320aaee",
"oidc_token": "***"
}
Created deployment for 945bbcc148d4bc792a32188277b80d150320aaee, ID: 945bbcc148d4bc792a32188277b80d150320aaee
Getting Pages deployment status...
Error: Artifact could not be deployed. Please ensure the content does not contain any hard links, symlinks and total size is less than [10](https://github.com/TheDevelolper/notedrop/actions/runs/9050589086/job/24866183439#step:2:11)GB. I'm not sure if it's because I've not specified a token? I'm trying to deploy an Astro site. |
Link is actually https://github.com/actions/upload-pages-artifact/tree/v1.0.10?tab=readme-ov-file#file-permissions. Setting the file permissions for my upload folder with |
I'm quite sure that the
is also triggered when there is no
index.html
file.The text was updated successfully, but these errors were encountered: