-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (54 loc) · 2.02 KB
/
upload-input-files-to-s3.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: upload-input-files-to-s3
on:
push:
branches:
- main
paths:
- .github/workflows/upload-input-files-to-s3.yaml
- inputs/*
defaults:
run:
shell: bash
jobs:
upload-input-files-to-s3:
name: Upload input files to s3
runs-on: ubuntu-latest
environment:
name: production
env:
python-version: 3.8
region: ap-southeast-2
strategy:
matrix:
account: [K_AWS_01]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.python-version }}
- uses: aws-actions/[email protected]
env:
AWS_ACCESS_KEY_ID_NAME: ${{ matrix.account }}_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY_NAME: ${{ matrix.account }}_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: ${{ env.region }}
with:
aws-access-key-id: ${{ secrets[env.AWS_ACCESS_KEY_ID_NAME] }}
aws-secret-access-key: ${{ secrets[env.AWS_SECRET_ACCESS_KEY_NAME] }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- run: echo "accountid=$(aws sts get-caller-identity | jq -r .Account)" >> $GITHUB_ENV
- id: Bucket
env:
bucket-suffix: ${{ secrets.BUCKET_SUFFIX }}
run: |
echo "name=curl-performance-test-${{ env.accountid }}-${{ env.region }}-${{ env.bucket-suffix }}" >> $GITHUB_OUTPUT
- name: Upload URL lists to S3
run: |
cp ./inputs/123456789012-${{ env.region }}.json ./inputs/${{ env.accountid }}-${{ env.region }}.json
aws s3 cp ./inputs/${{ env.accountid }}-${{ env.region }}.json s3://${{ steps.Bucket.outputs.name }}/inputs/ --region ${{ env.region }}
- name: Deploy CloudWatch Dashboard CurlPerformance
run: |
python3 -m venv env
source env/bin/activate
pip install -r scripts/requirements.txt
python3 scripts/deploy_dashboard.py -n CurlPerformance -f ./inputs/${{ env.accountid }}-${{ env.region }}.json -r ${{ env.region }}
deactivate