Skip to content

Synchronize R2

Synchronize R2 #69

Workflow file for this run

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@v3
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@v3
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 }}