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

How to use lfs with external storage? #2063

Open
retzero opened this issue Feb 6, 2025 · 1 comment
Open

How to use lfs with external storage? #2063

retzero opened this issue Feb 6, 2025 · 1 comment

Comments

@retzero
Copy link

retzero commented Feb 6, 2025

Hello.
I'd like to use our own s3-compatible storage for LFS blobs. It works fine in command line interface.
How to use this actions/checkout action for the same? Example usage is very welcome!

Here is my current .lfsconfig;

[lfs]
   url = "https://{ID}:{TOKEN}@my-external-s3.com"
@Danstiv
Copy link

Danstiv commented Feb 22, 2025

Hello @retzero!
I just ran into this problem.
We using Gitea as LFS server, ssh_known_hosts, ssh_configuration and ssh private key For Accessing Gitea Over SSH have been added to the REPOSITORY Secrets.
That Secrets is Correctly Appended to `/.ssh/config, ~/.ssh/known_hosts and ~/.ssh/privatekey files, but Fetching of LFS objects does not work.
That Action seems to simply ignore .lfsconfig with the right URL, and is trying to get lfs objects From Github.
So the solution is as follows:

  1. Configure ssh using repository / organization secrets.
  2. Use actions/checkout action to checkout repository, but keep lfs false by default.
  3. Fetch lfs objects manually!
      - name: Setup LFS
        shell: bash
        run: |
          mkdir -p ~/.ssh
          echo '${{ secrets.LFS_SSH_HOST_CONFIGURATION }}' >> ~/.ssh/config
          echo '${{ secrets.LFS_SSH_KNOWN_HOSTS }}' >> ~/.ssh/known_hosts
          echo '${{ secrets.LFS_SSH_PRIVATE_KEY }}' > ~/.ssh/private_key
          chmod 600 ~/.ssh/private_key

      - name: Checkout
        uses: actions/checkout@v4

      - name: Checkout lfs objects
        run: |
          git lfs install
          git lfs fetch
          git lfs checkout

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