-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (53 loc) · 1.75 KB
/
update-data-site.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
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
---
name: update-data-site
on:
workflow_dispatch:
workflow_run:
workflows: [create-public-files]
types:
- completed
env:
AWS_DEFAULT_REGION: us-east-1
# See: https://github.com/aws/aws-cli/issues/5262#issuecomment-705832151
AWS_EC2_METADATA_DISABLED: true
PYTHONUNBUFFERED: "1"
UV_SYSTEM_PYTHON: 1
jobs:
update-site:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-suffix: "site-data"
cache-dependency-glob: |
pyproject.toml
uv.lock
- name: Install Python
uses: actions/setup-python@v5
with:
python-version-file: .python-version
- name: Install Python dependencies
id: install-python-dependencies
shell: bash
run: uv pip install ".[site]" ".[data]"
- name: Setup Cloudflare credentials
uses: ./.github/actions/setup-cloudflare-s3
with:
CLOUDFLARE_S3_API_ACCESS_KEY_ID: ${{ secrets.CLOUDFLARE_S3_API_ACCESS_KEY_ID }}
CLOUDFLARE_S3_API_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFLARE_S3_API_SECRET_ACCESS_KEY }}
- name: Update data site
id: update-data-site
working-directory: 'data'
shell: bash
run: |
echo "::add-mask::${{ secrets.CLOUDFLARE_CACHE_API_TOKEN }}"
echo "::add-mask::${{ secrets.CLOUDFLARE_CACHE_ZONE_ID }}"
bucket=$(yq e '.s3.public_bucket' params.yaml)
python ./src/create_public_site.py
env:
CLOUDFLARE_CACHE_API_TOKEN: ${{ secrets.CLOUDFLARE_CACHE_API_TOKEN }}
CLOUDFLARE_CACHE_ZONE_ID: ${{ secrets.CLOUDFLARE_CACHE_ZONE_ID }}