upload-to-s3 #492
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: upload-to-s3 | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
# Schedule to run at midnight UTC | |
- cron: '0 0 * * *' | |
permissions: | |
id-token: write # This is required for requesting the JWT | |
contents: read # This is required for actions/checkout | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup repo | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.13.0 | |
- name: Install dependencies | |
run: npm ci | |
- name: Prepare build folder | |
run: INDEXER_TOKEN=${{ secrets.INDEXER_TOKEN }} npm run build | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install Python dependencies | |
run: pip install requests | |
- name: Fetch verified asset icons (verified by Pera) | |
run: python fetch_verified_asa_icons.py | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
role-to-assume: arn:aws:iam::023337100590:role/tinyman-asa-list--github-oidc | |
role-session-name: tinyman-asa-list--github-oidc | |
aws-region: eu-central-1 | |
- name: Upload to S3 bucket | |
run: aws s3 sync ./build/ s3://asa-icons --acl=public-read |