-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (34 loc) · 1.26 KB
/
upload-to-r2.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Upload to R2
on:
push:
branches: [ "main" ]
workflow_dispatch:
jobs:
Fetch:
runs-on: ubuntu-latest
steps:
- name: Checkout
run: |
git clone --depth 1 https://github.com/CollapseLauncher/CollapseLauncher-MetaRepo.git cl-meta
- name: Clean unused objects
run: |
rm -rf ./cl-meta/.git
rm -rf ./cl-meta/.github
rm -rf ./cl-meta/.gitignore
rm -rf ./cl-meta/scripts
- name: Sync Metadata root objects
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-meta
destination-dir: cl-meta
output-file-url: false
- 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 }"