-
Notifications
You must be signed in to change notification settings - Fork 2
88 lines (76 loc) · 2.61 KB
/
sync.yml
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Synchronize R2
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0' # once a week
jobs:
deb-repo:
name: Sync deb repository
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
lfs: true
- name: Sync repo with R2
env:
R2_ENDPOINT: https://a1220fd38ad4771f7b7b38f5f3c2b00d.r2.cloudflarestorage.com
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: auto
AWS_DEFAULT_OUTPUT: json
run: |
aws s3 cp key.gpg s3://relay-repos/ \
--no-progress \
--acl public-read \
--endpoint-url ${{ env.R2_ENDPOINT }}
aws s3 sync deb s3://relay-repos/deb \
--delete \
--size-only \
--no-progress \
--acl public-read \
--endpoint-url ${{ env.R2_ENDPOINT }}
aws s3 sync deb/dists s3://relay-repos/deb/dists/ \
--no-progress \
--acl public-read \
--endpoint-url ${{ env.R2_ENDPOINT }}
rpm-repo:
name: Sync rpm repository
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
lfs: true
- name: Sync repo with R2
env:
R2_ENDPOINT: https://a1220fd38ad4771f7b7b38f5f3c2b00d.r2.cloudflarestorage.com
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: auto
AWS_DEFAULT_OUTPUT: json
run: |
aws s3 cp key.gpg s3://relay-repos/ \
--no-progress \
--acl public-read \
--endpoint-url ${{ env.R2_ENDPOINT }}
aws s3 sync rpm s3://relay-repos/rpm \
--delete \
--size-only \
--no-progress \
--acl public-read \
--endpoint-url ${{ env.R2_ENDPOINT }}
aws s3 sync rpm/el7/repodata s3://relay-repos/rpm/el7/repodata/ \
--no-progress \
--acl public-read \
--endpoint-url ${{ env.R2_ENDPOINT }}
aws s3 sync rpm/el8/repodata s3://relay-repos/rpm/el8/repodata/ \
--no-progress \
--acl public-read \
--endpoint-url ${{ env.R2_ENDPOINT }}
aws s3 sync rpm/el9/repodata s3://relay-repos/rpm/el9/repodata/ \
--no-progress \
--acl public-read \
--endpoint-url ${{ env.R2_ENDPOINT }}