-
Notifications
You must be signed in to change notification settings - Fork 12
39 lines (32 loc) · 1.11 KB
/
upload-servers.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
name: Upload Servers
on:
push:
branches:
- main
jobs:
upload-servers-json:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r scripts/requirements.txt
- name: Validate servers & create index
run: |
python scripts/create_index.py
- name: Upload to R2
env:
AWS_ACCESS_KEY_ID: ${{ secrets.CF_R2_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: 'us-east-1'
CF_R2_BUCKET_NAME: ${{ secrets.CF_R2_BUCKET_NAME }}
CF_R2_URL: ${{ secrets.CF_R2_URL }}
run: |
aws s3 cp servers.json s3://${CF_R2_BUCKET_NAME}/server-repository/servers.json --endpoint-url https://${CF_R2_URL} --content-type "application/json" --cache-control "public, max-age=86400"