feat: VeChain whitelabel cross-app connect host (#620) #300
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
| # Simple workflow for deploying static content to Cloudfront | |
| name: Deploy to Cloudfront | |
| on: | |
| # Runs on pushes targeting the default branch | |
| push: | |
| branches: ['main'] | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| permissions: {} | |
| # Allow one concurrent deployment | |
| concurrency: | |
| group: 'cloudfront-deploy' | |
| cancel-in-progress: true | |
| jobs: | |
| build-and-deploy: | |
| permissions: | |
| contents: read | |
| id-token: write | |
| runs-on: ubuntu-latest | |
| env: | |
| NEXT_PUBLIC_BASE_PATH: '' | |
| NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID }} | |
| NEXT_PUBLIC_PRIVY_APP_ID: ${{ secrets.NEXT_PUBLIC_PRIVY_APP_ID }} | |
| NEXT_PUBLIC_PRIVY_CLIENT_ID: ${{ secrets.NEXT_PUBLIC_PRIVY_CLIENT_ID }} | |
| NEXT_PUBLIC_DELEGATOR_URL: ${{ secrets.NEXT_PUBLIC_DELEGATOR_URL }} | |
| NEXT_PUBLIC_NETWORK_TYPE: 'main' | |
| AWS_REGION: eu-west-1 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - name: Build App | |
| env: | |
| NODE_OPTIONS: '--max-old-space-size=8192' | |
| run: | | |
| yarn install | |
| yarn install:all | |
| yarn build | |
| - name: Fix permissions | |
| run: | | |
| chmod -c -R +rX "./examples/homepage/dist" | while read line; do | |
| echo "::warning title=Invalid file permissions automatically fixed::$line" | |
| done | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4 | |
| with: | |
| role-to-assume: ${{ secrets.AWS_ACC_ROLE }} | |
| aws-region: ${{ env.AWS_REGION }} | |
| - name: Deploy to S3 | |
| run: | | |
| aws s3 sync ./examples/homepage/dist s3://${{ secrets.AWS_BUCKET_NAME }} --delete | |
| - name: Copy Terms and Images files to Website | |
| run: | | |
| aws s3 cp s3://${{ secrets.AWS_DOCS_IMAGES_BUCKET }} s3://${{ secrets.AWS_BUCKET_NAME }} --recursive | |
| - name: Cloudfront Invalidation | |
| run: | | |
| AWS_MAX_ATTEMPTS=10 aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }} --paths '/' '/*' |