mirror of
https://github.com/Instadapp/trustwallet-assets.git
synced 2024-07-29 22:37:31 +00:00
invlidate cloudfront on new assets upload to s3 (#16634)
* invlidate cloudfront on new assets upload to s3
This commit is contained in:
parent
fcc5d0934d
commit
acaa6a1fed
29
.github/workflows/s3_upload.yml
vendored
29
.github/workflows/s3_upload.yml
vendored
|
@ -1,14 +1,16 @@
|
||||||
name: Upload S3
|
name: Upload S3
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches: [ master ]
|
||||||
- master
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
upload-s3:
|
upload-s3:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Upload (from main repo only)
|
- name: Upload (from main repo only)
|
||||||
if: github.repository_owner == 'trustwallet'
|
if: github.repository_owner == 'trustwallet'
|
||||||
uses: jakejarvis/s3-sync-action@master
|
uses: jakejarvis/s3-sync-action@master
|
||||||
|
@ -19,3 +21,24 @@ jobs:
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
AWS_REGION: 'us-east-1'
|
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"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user