|
28 | 28 | run: npm run build |
29 | 29 | env: |
30 | 30 | WEB3AUTH_CLIENT_ID: ${{ secrets.WEB3AUTH_CLIENT_ID }} |
| 31 | + |
| 32 | + - name: Pack and build example |
| 33 | + if: github.ref == 'refs/heads/master' |
| 34 | + run: | |
| 35 | + npm pack |
| 36 | + cd examples/demo-app |
| 37 | + npm install --legacy-peer-deps |
| 38 | + npm run build |
| 39 | +
|
| 40 | + # Set the credentials from repository settings/secrets |
| 41 | + - name: Configure AWS credentials |
| 42 | + if: github.ref == 'refs/heads/master' |
| 43 | + uses: aws-actions/configure-aws-credentials@v2 |
| 44 | + with: |
| 45 | + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 46 | + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 47 | + aws-region: ${{ secrets.AWS_REGION_US }} |
| 48 | + |
| 49 | + # Copy the files from build folder to the S3 bucket |
| 50 | + # Upload to S3 |
| 51 | + - name: sync s3 |
| 52 | + if: github.ref == 'refs/heads/master' |
| 53 | + uses: jakejarvis/s3-sync-action@master |
| 54 | + env: |
| 55 | + SOURCE_DIR: "./examples/demo-app/dist" |
| 56 | + AWS_REGION: "us-east-1" |
| 57 | + AWS_S3_BUCKET: "demo-eth.tor.us" |
| 58 | + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 59 | + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 60 | + |
| 61 | + # Invalidate Cloudfront (this action) |
| 62 | + - name: invalidate |
| 63 | + if: github.ref == 'refs/heads/master' |
| 64 | + uses: chaitanyapotti/cloudfront-update-distribution@v2 |
| 65 | + with: |
| 66 | + cloudfront-distribution-id: ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }} |
| 67 | + cloudfront-invalidation-required: true |
| 68 | + cloudfront-invalidation-path: "/*" |
| 69 | + cloudfront-wait-for-service-update: false |
0 commit comments