trustwallet-assets/.github/workflows/s3_upload.yml

45 lines
1.5 KiB
YAML
Raw Normal View History

name: Upload S3
on:
push:
branches: [ master ]
workflow_dispatch:
jobs:
upload-s3:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Upload (from main repo only)
if: github.repository_owner == 'trustwallet'
uses: jakejarvis/s3-sync-action@master
with:
2021-10-17 17:17:32 +00:00
args: --follow-symlinks --delete --exclude '*' --include 'dapps/*' --include 'blockchains/*' --include 'history/*' --size-only
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-east-1'
- name: Get changed files
uses: jitterbit/get-changed-files@v1
if: github.event_name == 'push'
id: files
- name: Filter files to invalidate
run: |
echo "::set-output name=paths::$(echo ${{ steps.files.outputs.added_modified }} | tr ' ' '\n' | grep -E 'blockchains/|dapps/' | awk '{print "/"$1}' | tr '\n' ' ')"
if: github.event_name == 'push'
id: filter
- name: Invalidate CloudFront
if: github.repository_owner == 'trustwallet' && github.event_name == 'push'
uses: chetan/invalidate-cloudfront-action@v2
env:
PATHS: ${{ steps.filter.outputs.paths }}"
DISTRIBUTION: ${{ secrets.DISTRIBUTION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: "us-east-1"