-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
56 lines (55 loc) · 2.1 KB
/
Copy pathpr-updated.yml
File metadata and controls
56 lines (55 loc) · 2.1 KB
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
name: PR Updated
on:
pull_request_target:
types:
- edited
jobs:
update-qa-config:
name: Update PR in QA Config
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout trusted source
uses: actions/checkout@v4
with:
ref: ${{ github.event.repository.default_branch }}
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y rclone
- name: Configure rclone for Cloudflare R2
run: |
mkdir -p ~/.config/rclone
cat > ~/.config/rclone/rclone.conf <<EOF
[cloudflare-r2]
type = s3
provider = Cloudflare
env_auth = false
access_key_id = ${{ secrets.CLOUDFLARE_R2_ACCESS_KEY_ID }}
secret_access_key = ${{ secrets.CLOUDFLARE_R2_SECRET_ACCESS_KEY }}
endpoint = ${{ secrets.CLOUDFLARE_R2_ENDPOINT }}
region = auto
EOF
- name: Lock QA config
if: github.event.pull_request.auto_merge == false
run: ./scripts/acquire_lock.sh installer/qa-config/.lock
- name: Update QA config entries
id: update_config
if: github.event.pull_request.auto_merge == false
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
PR_TITLE: ${{ github.event.pull_request.title }}
PR_BODY: ${{ github.event.pull_request.body }}
ADDON_KEYS: a32nx-msfs2024,a380x-msfs2024,a32nx-msfs2020,a380x-msfs2020
run: node ./scripts/update_qa_config.js
- name: Upload QA config to CDN
if: github.event.pull_request.auto_merge == false && steps.update_config.outputs.tracks-updated == 'true'
env:
CLOUDFLARE_CDN_ZONE_ID: ${{ secrets.CLOUDFLARE_CDN_ZONE_ID }}
CLOUDFLARE_PURGE_TOKEN: ${{ secrets.CLOUDFLARE_PURGE_TOKEN }}
CDN_BUCKET_DESTINATION: installer/qa-config/
run: ./scripts/cf-cdn.sh ./qa-config $CDN_BUCKET_DESTINATION
- name: Release QA config lock
if: always()
run: ./scripts/release_lock.sh installer/qa-config/.lock