From 245605dc55da8ba0793fa88f0286a70f5a36c39a Mon Sep 17 00:00:00 2001 From: DevTekVE Date: Sat, 29 Mar 2025 12:42:54 +0100 Subject: [PATCH] ci: Add LFS configuration and GitLab SSH to squash & merge script (#725) Integrate GitLab LFS handling by configuring LFS URLs and enabling SSH setup. This includes adding public GitLab keys and updating the workflow to support secure connections for LFS operations. Ensures proper handling of large files and seamless integration with GitLab. --- .../sunnypilot-master-dev-c3-prep.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/sunnypilot-master-dev-c3-prep.yaml b/.github/workflows/sunnypilot-master-dev-c3-prep.yaml index 2f3cbd68c1..54b80f3627 100644 --- a/.github/workflows/sunnypilot-master-dev-c3-prep.yaml +++ b/.github/workflows/sunnypilot-master-dev-c3-prep.yaml @@ -4,6 +4,8 @@ env: DEFAULT_SOURCE_BRANCH: "master-new" DEFAULT_TARGET_BRANCH: "nightly" PR_LABEL: "dev-c3" + LFS_URL: 'https://gitlab.com/sunnypilot/public/sunnypilot-new-lfs.git/info/lfs' + LFS_PUSH_URL: 'ssh://git@gitlab.com/sunnypilot/public/sunnypilot-new-lfs.git' on: workflow_dispatch: @@ -34,6 +36,15 @@ jobs: run: | git config --global user.name 'github-actions[bot]' git config --global user.email 'github-actions[bot]@users.noreply.github.com' + + - name: Set up SSH + uses: webfactory/ssh-agent@v0.9.0 + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + + - name: Add GitLab public keys + run: | + ssh-keyscan -H gitlab.com >> ~/.ssh/known_hosts - name: Set up Python uses: actions/setup-python@v5 @@ -113,6 +124,13 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Update LFS Config + run: | + echo '[lfs]' > .lfsconfig + echo ' url = ${{ env.LFS_URL }}' >> .lfsconfig + echo ' pushurl = ${{ env.LFS_PUSH_URL }}' >> .lfsconfig + echo ' locksverify = false' >> .lfsconfig + - name: Push changes if there are diffs id: push-changes # Add an id so we can reference this step run: |