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

Download pages artifact #57

Closed
hfhbd opened this issue Apr 17, 2023 · 5 comments
Closed

Download pages artifact #57

hfhbd opened this issue Apr 17, 2023 · 5 comments
Assignees
Labels
wontfix This will not be worked on

Comments

@hfhbd
Copy link

hfhbd commented Apr 17, 2023

Is there an orthogonal action to download the actual website/pages artifact? The uploaded github-pages artifact attached to the CI output expired after a few days.

@JamesMGreene JamesMGreene added the wontfix This will not be worked on label Apr 30, 2023
@JamesMGreene JamesMGreene self-assigned this Apr 30, 2023
@JamesMGreene
Copy link
Contributor

Although this action's default retention period for uploaded artifacts defaults to roughly 24 hours, you can extend that to up to 90 days (unless your organization specifies a shorter timeline) using the retention-days input parameter:

retention-days:
description: "Duration after which artifact will expire in days."
required: false
default: "1"

Moving beyond that to your general question:

There is not currently a way to retrieve or reconstruct a Pages site's artifact after it is deployed today (or at least once the artifact's retention period has expired).

💡 It is an interesting idea, though! Definitely open to considering adding backend support and a separate Action for it in the future, but it's not something we can prioritize right now. 😕

FWIW, I've added an item to the Pages team backlog to consider this in the future. No promises that it will happen or any forecasted timeline, though. ❤️

If you wanted to work around it for now (without using a gh-pages style branch 😓), you could probably also create a less performant option by:

  1. Including some sort of manifest file (JSON, YAML, XML, whatever) cataloguing all of the files to be included in your Packages artifact, and then include that file in the artifact as well
  2. Creating an Action or script to subsequently download that manifest file, and then download each of the catalogued assets (plus needing to create directory structures, etc.).

It's not pretty, but just wanted to pitch the idea in case it helps. 🤞🏻 🤷🏻

Related:

@JamesMGreene JamesMGreene closed this as not planned Won't fix, can't repro, duplicate, stale Apr 30, 2023
@hfhbd
Copy link
Author

hfhbd commented Apr 30, 2023

Thank you for your answer and the workaround, I will try it.

I will just add my use case for your internal backlog item:

I want to document the API of my library. This library has different versions, and the documentation (Javadoc) supports different API versions with a UI version picker. At the moment, I need to store the old API docs on the docs branch to keep and link the old docs.
With the new GitHub, actions deploy/upload pages artifact, there is no need for a separate docs branch, but to link the old docs, you need to fetch the old docs.

The workaround, to checkout old tags of the library and built the documentation during a new release, often doesn't work, easily due to dependency/JVM or os support, for example, older versions of the library don't support a current JVM, so you would need to switch to an older JVM too.

@RebeccaStevens
Copy link

@hfhbd Did you find a nice way to do this?

@hfhbd
Copy link
Author

hfhbd commented Sep 9, 2023

@RebeccaStevens We tried the index and download option, but it didn't work well due the download overhead, so we keep a checked in docs folder, which is updated/keep in sync by our build tool. Not ideal, but better than having a gh-Pages branch.

@fulldecent
Copy link

Here is a workaround

Stop doing:

  1. actions/upload-pages-artifact@v1
  2. actions/deploy-pages@v2

Instead do:

  1. actions/cache/save@v3
  2. actions/upload-pages-artifact@v1
  3. actions/deploy-pages@v2

And download with:

  1. actions/cache/restore@v3

akkornel added a commit to stanford-rc/globus.stanford.edu that referenced this issue Feb 14, 2025
Thinking ahead, it may be useful to compare a pending change to the
live site.  In order to do that, we need a way to access the live site.
This can be a problem since GitHub Actions artifacts have a lifetime.

Following the advice in [1], use the GitHub Actions cache to store a
copy of the live site during deployment.

[1]: actions/upload-pages-artifact#57 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

4 participants