Skip to content
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

Out-of-repo deployment doesn't work for me #2403

Open
cormullion opened this issue Jan 16, 2024 · 17 comments
Open

Out-of-repo deployment doesn't work for me #2403

cormullion opened this issue Jan 16, 2024 · 17 comments

Comments

@cormullion
Copy link
Contributor

I'm trying to move https://github.com/JuliaGraphics/Luxor.jl docs to https://github.com/JuliaGraphics/LuxorManual. I followed the instructions in the Documenter docs here.

The two keys were added to the correct locations, as far as I can tell, and the make.jl was updated with this:

repo = "github.com/JuliaGraphics/LuxorManual.git"
withenv("GITHUB_REPOSITORY" => repo) do
    deploydocs(
      repo = repo,
      target = "build",
      push_preview = true,
      forcepush = true,
    )
end

The error message here says:

fatal: repository 'https://github.com/github.com/JuliaGraphics/LuxorManual.git.git/' not found

so it's possible the make.jl code I added is wrong, but not sure how...?

@goerz
Copy link
Member

goerz commented Jan 16, 2024

Remove the ".git" in repo?

@cormullion
Copy link
Contributor Author

Thank! Yes, the path looks better now, but although this link looks valid

https://github.com/JuliaGraphics/Luxor.jl/actions/runs/7544837907/job/20539088958#step:7:508

there's still an access error. Perhaps the secret keys aren't correctly set.

@goerz
Copy link
Member

goerz commented Jan 16, 2024

Yeah, that looks like the secrets aren’t set up right in the two repositories

@cormullion
Copy link
Contributor Author

I’ll try and do them again tomorrow. It’s by far the worst aspect of working with Julia… 😂

@goerz
Copy link
Member

goerz commented Jan 16, 2024

I'd try deleting all keys and secrets from both repos and start from scratch with DocumenterTools.genkeys

@cormullion
Copy link
Contributor Author

I did the process again:

Screenshot 2024-01-17 at 10 10 48

Error is:

remote: Permission to JuliaGraphics/LuxorManual.git denied to github-actions[bot].
[507](https://github.com/JuliaGraphics/Luxor.jl/actions/runs/7544837907/job/20564991449#step:7:508)
fatal: unable to access 'https://github.com/JuliaGraphics/LuxorManual.git/': The requested URL returned error: 403
[508](https://github.com/JuliaGraphics/Luxor.jl/actions/runs/7544837907/job/20564991449#step:7:509)
┌ Error: Failed to push:
[509](https://github.com/JuliaGraphics/Luxor.jl/actions/runs/7544837907/job/20564991449#step:7:510)
│   exception =
[510](https://github.com/JuliaGraphics/Luxor.jl/actions/runs/7544837907/job/20564991449#step:7:511)
│    failed process: Process(setenv(`/home/runner/.julia/artifacts/5d776960702ec06ebaac2a94fd96a1c44e8cb04a/bin/git push -fq upstream HEAD:gh-pages`,

make.jl code is:

repo = "JuliaGraphics/LuxorManual"
withenv("GITHUB_REPOSITORY" => repo) do
    deploydocs(
      repo = repo,
      target = "build",
      push_preview = true,
      forcepush = true,
    )
end

So I think the documented procedure isn't working ... ?

@cormullion
Copy link
Contributor Author

@mortenpi Does my screenshot above look correct? It’s my best guess based on the current documentation…

@mortenpi
Copy link
Member

Don't think you have DOCUMENTER_KEY set up right, since it's trying to use GITHUB_TOKEN: https://github.com/JuliaGraphics/Luxor.jl/actions/runs/7544837907/job/20539088958#step:7:133 (also #2165).

Any reason you're trying to configure an environment, rather than just setting up a global secret? I assume the workflow just doesn't have access to the environment.. I think you have to explicitly tell a workflow to use an environment.

@cormullion
Copy link
Contributor Author

Any reason you're trying to configure an environment

I have no idea 😀I think the output of generate_keys said to create an environment variable so I added it. Did I add it to the wrong place?

@goerz
Copy link
Member

goerz commented Jan 26, 2024

Should be in "Secrets and variables"

@cormullion
Copy link
Contributor Author

Should be in "Secrets and variables"

Thanks... I'm obviously the only one to be confused by this but I don't get it at all :(

The Secrets tab has 3 secrets panels - the Documenter docs say "Add the DOCUMENTER_KEY secret to the "source" repository". The genkeys() text says "add a secure environment variable" and the Variables tab has 3 variables panels...

rather than just setting up a global secret?

I can't see any 'global secrets? Just 'Environment Secrets', 'Repository Secrets' and 'Organisation Secrets'.

I'll try copying "the secure environment variable named 'DOCUMENTER_KEY'" to the "Actions secrets and variables/Environment secrets" panel and see if that works.

Thanks for the help though! :)

@goerz
Copy link
Member

goerz commented Jan 26, 2024

I'm confused about this myself. I have the impression that the Github UI is somewhat redundant: the same "secrets" are accessible in multiple places, as far as I can tell. They've also changed the UI over the last year or so. At some point, we should change genkeys to give less ambiguous instructions.

But basically, the SSH key goes into Security > Deploy Keys

CleanShot 2024-01-26 at 13 06 40@2x

And the DOCUMENTER_KEY variable goes into Secrets and Variables > Actions > Repository Secrets

CleanShot 2024-01-26 at 13 07 18@2x

Those screenshots are from a standard setup where the documentation is deployed to the same repository. I guess for out-of-repo deployment those two settings are just in different repositories, but otherwise it's the same. I haven't set up out-of-repo deployment myself, though.

@cormullion
Copy link
Contributor Author

Thanks, @goerz - the pictures are worth a thousand words. I think I have set the keys and secrets correctly now. As you say I think Github must have changed the UI recently...

The error now is :

ssh: Could not resolve hostname juliagraphics: Temporary failure in name resolution
fatal: Could not read from remote repository.

so I'll try again later this weekend to see if this "temporary failure" really is temporary, or is the next obstacle for me.

@goerz
Copy link
Member

goerz commented Jan 27, 2024

The line repo = "JuliaGraphics/LuxorManual" in your make.jl is wrong: that should probably be repo = "github.com/JuliaGraphics/LuxorManual.git", according to the documentation.

@cormullion
Copy link
Contributor Author

Thanks! I’ll try that again (it didn’t work before, but perhaps it will work better with the new secrets…).

@cormullion
Copy link
Contributor Author

It finally works. Thanks for your help!

@goerz
Copy link
Member

goerz commented Jan 27, 2024

My pleasure! It's the least I can do as a small Thank You for JuliaMono!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants