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

Deploy to a different repository #15

Open
BeastyBlacksmith opened this issue May 12, 2021 · 4 comments
Open

Deploy to a different repository #15

BeastyBlacksmith opened this issue May 12, 2021 · 4 comments

Comments

@BeastyBlacksmith
Copy link

Can I use this action to deploy the docs in a different repo than the action is run?

@SaschaMann
Copy link
Member

I'm not familiar enough with Documenter to know what it would take.

The action effectively runs

julia --color=yes --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
julia --color=yes --project=docs/ docs/make.jl

in most cases. Does the Julia part of the deployment to a different repo happen in docs/make.jl? If so, I think it should be possible.

You can checkout a different repo in the workflow by adding an appropriate input to the checkout action, in case that's needed:

- uses: actions/checkout@v2
  with:
    repository: julialang/Example.jl

Hope this is useful. If you tell me how it works in Documenter or via other CI systems, I might be able to help you out better.

@BeastyBlacksmith
Copy link
Author

Okay that is good to know. I actually need that, since the make.jl is in PlotDocs.jl.
The only Problem is that it would need to load the Plots version from the branch that triggers the action and not the registered version.
From what I get from the Documenter docs is that it should work, if I set a key (for Plots I suppose).
My current attempt is here, but also the docs are broken, which makes things a bit hard to check (which is why I want to run them more often)

@SaschaMann
Copy link
Member

The only Problem is that it would need to load the Plots version from the branch that triggers the action and not the registered version.

actions/checkout can also take a ref as input. You can access the ref that triggered the workflow, i.e. the branch or tag, via ${{ github.ref }}. This is untested and I'm not fully sure I understand your setup yet but I think you may be able to use

- uses: actions/checkout@v2
  with:
    repository: julialang/Example.jl
    ref: ${{ github.ref }}

as part of the workflow

@BeastyBlacksmith
Copy link
Author

So it turned out that it doesn't work because Documenter checks for the GITHUB_REPOSITORY environment variable, which Points to the wrong directory then, so I had to wrap the execution of make.jl in withenv

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

No branches or pull requests

2 participants