Skip to content

[Github Actions] Improve HTML cache implementation #14

Closed

Description

@mmcky

It would be good to have caching to enable

  1. complete website previews for Pull Requests

Activity

  1. self-assigned this
    on Apr 29, 2020
  2. mmcky commented on Apr 29, 2020

    @mmcky
    ContributorAuthor

    The GitHub implementation of cache works but isn't up-dateable.

    So it would give the "feel" of a complete site but the PR will build the changed RST files and overwrite those lectures in the _build/website/jupyter_html folder.

    I have written to GitHub to see if there is a way to save/retrieve artifacts to a central location to get updated copies of the site as PR's roll through.

  3. mmcky commented on May 8, 2020

    @mmcky
    ContributorAuthor
    • We could have a daily cache with the date parameter added to the cache key if this becomes an issue.
    jobs:
      build:
        runs-on: ubuntu-latest
        steps:
          - name: Get current date
            id: date
            run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
    
  4. changed the title [-]Add caching to Github Action workflows[/-] [+]Update Stale Cache for HTML Previews[/+] on May 8, 2020
  5. mmcky commented on May 11, 2020

    @mmcky
    ContributorAuthor

    Included an implementation for daily caching for html previews.

    • may need to consider the condition when cache is building for the day and is unavailable as an improvement to use previous days cache
  6. changed the title [-]Update Stale Cache for HTML Previews[/-] [+]Improve HTML cache implementation[/+] on May 11, 2020
  7. mmcky commented on May 12, 2020

    @mmcky
    ContributorAuthor

    So cache is incompatible with a scheduled type run. We won't get full html previews until this is merged.

    actions/cache#63

    • consider previous stale cache implementation to restore the look and feel of "full" html previews
  8. mmcky commented on May 19, 2020

    @mmcky
    ContributorAuthor

    This will need to remain open until Github fixes cache builds to run on a schedule

  9. changed the title [-]Improve HTML cache implementation[/-] [+][Github Actions] Improve HTML cache implementation[/+] on Jun 1, 2020
  10. mmcky commented on Jun 1, 2020

    @mmcky
    ContributorAuthor

    Response from GitHub


    We're sorry for the delay here -- thanks for reaching out! After speaking with our engineers about this, they let us know that you could use actions/cache for the case you've described around pull requests. Choosing a restore key that matches up with the number of the pull request might be one approach. However, they also let us know that pull requests cannot access their own caches.

    Our team let us know that there's some open discussion around downloading artifacts from a different workflow using our API:

    actions/download-artifact#3
    https://developer.github.com/v3/actions/artifacts/
    It's not possible to "share" artifacts between different workflows, but the API offers endpoints for programmatic access to download an artifact from another workflow. Granted, you would need to write your own script for doing this as there's not one official GitHub Action that does this.

    If you have any more specific questions about using actions/cache, we highly encourage you to bring your use case in the form of an issue here:

    https://github.com/actions/cache/issues

    We're well-equipped to advise on GitHub Actions as it's documented in http://help.github.com/en/actions, but any specific advice for using the actions available in https://github.com/actions are best suited in the respective repository hosting that action.

    We hope this helps! For any other questions related to workflow configuration, such as syntax, virtual environments, or building actions, we recommend searching for an existing thread or create a new one in our GitHub Community Forum:

    https://github.community/t5/GitHub-Actions/bd-p/actions

  11. mmcky commented on Nov 17, 2022

    @mmcky
    ContributorAuthor

    A cache strategy has been developed that allows using assets from cache.yml which runs whenever the main branch is updated. This greatly reduces build times for PRs, previews and deployments.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions