From 63e4cb90515a773431322d59064cf079acd3ce94 Mon Sep 17 00:00:00 2001 From: Ext1nguisher <162774918+Ext1nguisher@users.noreply.github.com> Date: Sat, 16 Nov 2024 20:42:57 +0800 Subject: [PATCH 1/9] Create main.yml --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1 @@ + From 5271cbe6c9126a5ca662d092d765ca7a854d2e65 Mon Sep 17 00:00:00 2001 From: Ext1nguisher <162774918+Ext1nguisher@users.noreply.github.com> Date: Sat, 16 Nov 2024 20:58:44 +0800 Subject: [PATCH 2/9] Update main.yml --- .github/workflows/main.yml | 49 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8b13789..eb8c9d7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1 +1,50 @@ +name: Sync to Alist via WebDAV +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + sync_to_alist: + runs-on: ubuntu-latest + steps: + # Checkout repository + - name: Checkout repository + uses: actions/checkout@v2 + + # Install rclone + - name: Install rclone + run: | + curl https://rclone.org/install.sh | sudo bash + + # Configure rclone for WebDAV + - name: Configure rclone for WebDAV + run: | + rclone config create alist_webdav webdav \ + url http://${{ secrets.WEBDAV_HOST }}:${{ secrets.WEBDAV_PORT }}/dav \ + user ${{ secrets.ALIST_USERNAME }} \ + pass ${{ secrets.ALIST_PASSWORD }} + + # Check current working directory (debugging step) + - name: Print current working directory + run: | + pwd + ls -al + + # Clear the target folder on Alist WebDAV + - name: Clear target folder on Alist WebDAV + run: | + rclone delete alist_webdav:/ --rmdirs # Deletes all files and empty directories from the target folder + + # Sync all files to Alist WebDAV (sync the entire repo) + - name: Sync all files to Alist + run: | + rclone copy ./ alist_webdav:/ --checksum --size-only --retries 3 # Force update every time + + # Optionally, clean up rclone configuration (for security) + - name: Clean up rclone config + run: rm -rf ~/.config/rclone From 3f4b74c88c1bcbf13693b7d775c5942a1eea3096 Mon Sep 17 00:00:00 2001 From: Ext1nguisher <162774918+Ext1nguisher@users.noreply.github.com> Date: Sat, 16 Nov 2024 21:01:59 +0800 Subject: [PATCH 3/9] Rename main.yml to Sync-to-Alist-via-WebDAV.yml --- .github/workflows/{main.yml => Sync-to-Alist-via-WebDAV.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{main.yml => Sync-to-Alist-via-WebDAV.yml} (100%) diff --git a/.github/workflows/main.yml b/.github/workflows/Sync-to-Alist-via-WebDAV.yml similarity index 100% rename from .github/workflows/main.yml rename to .github/workflows/Sync-to-Alist-via-WebDAV.yml From 548b7f4019a6502650149f9dfcef06caceeba7bc Mon Sep 17 00:00:00 2001 From: Ext1nguisher <162774918+Ext1nguisher@users.noreply.github.com> Date: Sat, 16 Nov 2024 21:04:17 +0800 Subject: [PATCH 4/9] Update Sync-to-Alist-via-WebDAV.yml From 927bba5e1ddf743d5e5e7033d6184b67bedd8834 Mon Sep 17 00:00:00 2001 From: Ext1nguisher <162774918+Ext1nguisher@users.noreply.github.com> Date: Sat, 16 Nov 2024 21:07:07 +0800 Subject: [PATCH 5/9] Update Sync-to-Alist-via-WebDAV.yml --- .github/workflows/Sync-to-Alist-via-WebDAV.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/Sync-to-Alist-via-WebDAV.yml b/.github/workflows/Sync-to-Alist-via-WebDAV.yml index eb8c9d7..35c3017 100644 --- a/.github/workflows/Sync-to-Alist-via-WebDAV.yml +++ b/.github/workflows/Sync-to-Alist-via-WebDAV.yml @@ -7,6 +7,8 @@ on: pull_request: branches: - main + schedule: + - cron: 0 1 * * * jobs: sync_to_alist: From dd56ba22063bfdd6f9927de1ae3f586346a3cb0e Mon Sep 17 00:00:00 2001 From: Ext1nguisher <162774918+Ext1nguisher@users.noreply.github.com> Date: Sat, 16 Nov 2024 21:16:34 +0800 Subject: [PATCH 6/9] Update Sync-to-Alist-via-WebDAV.yml --- .github/workflows/Sync-to-Alist-via-WebDAV.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Sync-to-Alist-via-WebDAV.yml b/.github/workflows/Sync-to-Alist-via-WebDAV.yml index 35c3017..8776567 100644 --- a/.github/workflows/Sync-to-Alist-via-WebDAV.yml +++ b/.github/workflows/Sync-to-Alist-via-WebDAV.yml @@ -27,9 +27,9 @@ jobs: - name: Configure rclone for WebDAV run: | rclone config create alist_webdav webdav \ - url http://${{ secrets.WEBDAV_HOST }}:${{ secrets.WEBDAV_PORT }}/dav \ - user ${{ secrets.ALIST_USERNAME }} \ - pass ${{ secrets.ALIST_PASSWORD }} + url http://${{secrets.WEBDAV_HOST}}:${{secrets.WEBDAV_PORT}}/dav \ + user ${{secrets.ALIST_USERNAME}} \ + pass ${{secrets.ALIST_PASSWORD}} # Check current working directory (debugging step) - name: Print current working directory From 76b5289674fc0cac3e14b9cdbcf1be8134c467e0 Mon Sep 17 00:00:00 2001 From: Ext1nguisher <162774918+Ext1nguisher@users.noreply.github.com> Date: Sat, 16 Nov 2024 21:35:00 +0800 Subject: [PATCH 7/9] Update Sync-to-Alist-via-WebDAV.yml --- .github/workflows/Sync-to-Alist-via-WebDAV.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Sync-to-Alist-via-WebDAV.yml b/.github/workflows/Sync-to-Alist-via-WebDAV.yml index 8776567..35c3017 100644 --- a/.github/workflows/Sync-to-Alist-via-WebDAV.yml +++ b/.github/workflows/Sync-to-Alist-via-WebDAV.yml @@ -27,9 +27,9 @@ jobs: - name: Configure rclone for WebDAV run: | rclone config create alist_webdav webdav \ - url http://${{secrets.WEBDAV_HOST}}:${{secrets.WEBDAV_PORT}}/dav \ - user ${{secrets.ALIST_USERNAME}} \ - pass ${{secrets.ALIST_PASSWORD}} + url http://${{ secrets.WEBDAV_HOST }}:${{ secrets.WEBDAV_PORT }}/dav \ + user ${{ secrets.ALIST_USERNAME }} \ + pass ${{ secrets.ALIST_PASSWORD }} # Check current working directory (debugging step) - name: Print current working directory From fe424b054acaede3715f2422eb851620d9e9cad9 Mon Sep 17 00:00:00 2001 From: Ext1nguisher <162774918+Ext1nguisher@users.noreply.github.com> Date: Sat, 16 Nov 2024 21:57:41 +0800 Subject: [PATCH 8/9] Update Sync-to-Alist-via-WebDAV.yml --- .github/workflows/Sync-to-Alist-via-WebDAV.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/Sync-to-Alist-via-WebDAV.yml b/.github/workflows/Sync-to-Alist-via-WebDAV.yml index 35c3017..6742302 100644 --- a/.github/workflows/Sync-to-Alist-via-WebDAV.yml +++ b/.github/workflows/Sync-to-Alist-via-WebDAV.yml @@ -27,9 +27,7 @@ jobs: - name: Configure rclone for WebDAV run: | rclone config create alist_webdav webdav \ - url http://${{ secrets.WEBDAV_HOST }}:${{ secrets.WEBDAV_PORT }}/dav \ - user ${{ secrets.ALIST_USERNAME }} \ - pass ${{ secrets.ALIST_PASSWORD }} + url http://pclhomeplazaoss.lingyunawa.top:26994//dav%20user%20Ext1nguisher%20pass%20Ext1nguisher@Alist # Check current working directory (debugging step) - name: Print current working directory From 59c5908f59b654c45676cbf3525eebbd90303b9a Mon Sep 17 00:00:00 2001 From: Ext1nguisher <162774918+Ext1nguisher@users.noreply.github.com> Date: Sat, 16 Nov 2024 22:00:05 +0800 Subject: [PATCH 9/9] Update Sync-to-Alist-via-WebDAV.yml --- .github/workflows/Sync-to-Alist-via-WebDAV.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Sync-to-Alist-via-WebDAV.yml b/.github/workflows/Sync-to-Alist-via-WebDAV.yml index 6742302..35c3017 100644 --- a/.github/workflows/Sync-to-Alist-via-WebDAV.yml +++ b/.github/workflows/Sync-to-Alist-via-WebDAV.yml @@ -27,7 +27,9 @@ jobs: - name: Configure rclone for WebDAV run: | rclone config create alist_webdav webdav \ - url http://pclhomeplazaoss.lingyunawa.top:26994//dav%20user%20Ext1nguisher%20pass%20Ext1nguisher@Alist + url http://${{ secrets.WEBDAV_HOST }}:${{ secrets.WEBDAV_PORT }}/dav \ + user ${{ secrets.ALIST_USERNAME }} \ + pass ${{ secrets.ALIST_PASSWORD }} # Check current working directory (debugging step) - name: Print current working directory