Injective list - Upload Files #6092
This file contains hidden or 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: Injective list - Upload Files | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| deploy: | |
| name: "Trigger upload" | |
| runs-on: blacksmith-8vcpu-ubuntu-2204 | |
| env: | |
| ## Github Actions | |
| SKIP_DEPLOYMENTS: ${{ secrets.SKIP_DEPLOYMENTS }} | |
| steps: | |
| # This is here solely for testing and running this action locally with ACT - it shouldn't be needed for running on github as the images in gh actions should already have the AWS CLI installed | |
| - name: Install Act dependencies | |
| if: ${{ env.ACT }} | |
| run: | | |
| apt-get update && apt-get install sudo -y && apt-get install wget -y && apt-get install unzip -y | |
| - name: Install AWS if running locally | |
| if: ${{ env.ACT }} | |
| uses: unfor19/install-aws-cli-action@v1 | |
| with: | |
| version: 2 # default | |
| verbose: true # default | |
| arch: amd64 # allowed values: amd64, arm64 | |
| - name: Checkout | |
| uses: actions/checkout@main | |
| - name: Setup AWS CLI | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| aws-region: us-east-1 | |
| - name: Sync files to S3 bucket | |
| run: | | |
| aws s3 sync json s3://injective-lists/json --delete | |
| - name: Invalidate CloudFront cache | |
| run: | | |
| aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*" | |
| - name: Sleep for 60s | |
| uses: juliangruber/[email protected] | |
| with: | |
| time: 60s | |
| - name: Invalidate CloudFront cache | |
| run: | | |
| aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*" |