-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (44 loc) · 1.47 KB
/
schedule-import.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
name: Scheduled Import for All Projects
on:
schedule:
- cron: "0 */6 * * *"
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Install Cargo Lambda with pip3
run: |
pip3 install cargo-lambda
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Loop through all JSON files in data/projects
run: |
for file in data/projects/*.json; do
# Echo out the current file name
echo "About to process file: $file"
FILE_NAME=$(basename "$file")
echo "Base file name: $FILE_NAME"
cargo run -p generate_import_payload -- $file
cd src/import
cargo lambda invoke --remote gh-import-issues --region us-east-1 --data-file payloads/$FILE_NAME
# Return to the root directory
cd -
done
- name: Revalidate caches
run: |
echo "Revalidating cache for latest issues"
curl --request POST "${{ vars.REVALIDATE_CACHE_URL }}/latest-issues" \
--header "${{ secrets.AUTH_HEADER }}"