Re-enable HSR repair function after 1.5.0 update #86
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Upload to R2 | |
on: | |
push: | |
branches: [ "main" ] | |
workflow_dispatch: | |
jobs: | |
Sync-Root: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fetch | |
uses: neon-nyan/CollapseLauncher-ReleaseRepo/actions/r2-fetcher@main | |
- name: Sync Root Folder | |
uses: ryand56/r2-upload-action@latest | |
with: | |
r2-account-id: ${{ secrets.R2_ACCOUNT_ID }} | |
r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }} | |
r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }} | |
r2-bucket: ${{ secrets.R2_BUCKET }} | |
source-dir: cl-cdn/folderroot | |
destination-dir: cl-cdn | |
output-file-url: false | |
Sync-Metadata: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fetch | |
uses: neon-nyan/CollapseLauncher-ReleaseRepo/actions/r2-fetcher@main | |
- name: Sync Metadata | |
uses: ryand56/r2-upload-action@latest | |
with: | |
r2-account-id: ${{ secrets.R2_ACCOUNT_ID }} | |
r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }} | |
r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }} | |
r2-bucket: ${{ secrets.R2_BUCKET }} | |
source-dir: cl-cdn/metadata | |
destination-dir: cl-cdn/metadata | |
output-file-url: false | |
Sync-ApplyUpdate: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fetch | |
uses: neon-nyan/CollapseLauncher-ReleaseRepo/actions/r2-fetcher@main | |
- name: Sync Stable ApplyUpdate | |
uses: ryand56/r2-upload-action@latest | |
with: | |
r2-account-id: ${{ secrets.R2_ACCOUNT_ID }} | |
r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }} | |
r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }} | |
r2-bucket: ${{ secrets.R2_BUCKET }} | |
source-dir: cl-cdn/stable | |
destination-dir: cl-cdn/stable | |
output-file-url: false | |
- name: Sync Preview ApplyUpdate | |
uses: ryand56/r2-upload-action@latest | |
if: always() | |
with: | |
r2-account-id: ${{ secrets.R2_ACCOUNT_ID }} | |
r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }} | |
r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }} | |
r2-bucket: ${{ secrets.R2_BUCKET }} | |
source-dir: cl-cdn/preview | |
destination-dir: cl-cdn/preview | |
output-file-url: false | |
Sync-Squirell: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fetch | |
uses: neon-nyan/CollapseLauncher-ReleaseRepo/actions/r2-fetcher@main | |
- name: Sync Squirrel\Preview folder | |
uses: ryand56/r2-upload-action@latest | |
with: | |
r2-account-id: ${{ secrets.R2_ACCOUNT_ID }} | |
r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }} | |
r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }} | |
r2-bucket: ${{ secrets.R2_BUCKET }} | |
source-dir: cl-cdn/squirrel/preview | |
destination-dir: cl-cdn/squirrel/preview | |
output-file-url: false | |
- name: Sync Squirrel\Stable folder | |
uses: ryand56/r2-upload-action@latest | |
if: always() | |
with: | |
r2-account-id: ${{ secrets.R2_ACCOUNT_ID }} | |
r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }} | |
r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }} | |
r2-bucket: ${{ secrets.R2_BUCKET }} | |
source-dir: cl-cdn/squirrel/stable | |
destination-dir: cl-cdn/squirrel/stable | |
output-file-url: false | |
Purge-Cache: | |
runs-on: ubuntu-latest | |
if: always() # always purge cache whenever it fails or succeed | |
needs: [Sync-Root, Sync-Metadata, Sync-ApplyUpdate, Sync-Squirell] | |
steps: | |
- name: Purge Cloudflare cache | |
run: | | |
curl -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_PURGE_CACHE_ZONEID }}/purge_cache" \ | |
-H "Authorization: Bearer ${{ secrets.CF_PURGE_CACHE_TOKEN }}" \ | |
-H "Content-Type: application/json" \ | |
--data "{ \"purge_everything\": true }" |