fix: smoothen onboarding + PR feedbacks #68
Workflow file for this run
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: Helix Mainnet Deployments | ||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| branches: | ||
| - master | ||
| jobs: | ||
| mainnet: | ||
| if: false | ||
| name: 'Deploy to mainnet' | ||
| runs-on: blacksmith-8vcpu-ubuntu-2204 | ||
| timeout-minutes: 45 | ||
| env: | ||
| ## Public | ||
| VITE_NAME: 'Helix | The Premier Decentralized Spot and Derivatives Exchange' | ||
| VITE_PRODUCT: helix | ||
| VITE_BASE_URL: https://helixapp.com | ||
| VITE_ENV: mainnet | ||
| VITE_NETWORK: internal | ||
| VITE_ETHEREUM_CHAIN_ID: 1 | ||
| VITE_CHAIN_ID: injective-1 | ||
| SOURCE_DIR: .output/public | ||
| DEST_DIR: www | ||
| ## Github Actions | ||
| ACTIONS_ALLOW_UNSECURE_COMMANDS: true | ||
| ## Flags | ||
| VITE_SHOW_REDEEM_VOUCHER: true | ||
| VITE_MAINTENANCE_DISABLED: false | ||
| VITE_IS_ONRAMPER_DEV_MODE: false | ||
| ## Endpoints | ||
| # VITE_INDEXER_API_ENDPOINT: '' | ||
| VITE_INDEXER_API_ENDPOINT: '' | ||
| VITE_CHRONOS_API_ENDPOINT: '' | ||
| VITE_EXPLORER_API_ENDPOINT: '' | ||
| VITE_SENTRY_GRPC_ENDPOINT: '' | ||
| VITE_SENTRY_REST_ENDPOINT: '' | ||
| ## Geo location & VPN checks | ||
| VITE_VPN_CHECKS_ENABLED: false | ||
| VITE_GEO_IP_RESTRICTIONS_ENABLED: true | ||
| VITE_GOOGLE_MAPS_KEY: ${{ secrets.VITE_GOOGLE_MAPS_KEY }} | ||
| VITE_PROXY_DETECTION_API_KEY: ${{ secrets.VITE_PROXY_DETECTION_API_KEY }} | ||
| ## Secret | ||
| GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||
| NUXT_CLARITY_ID: ${{ secrets.NUXT_CLARITY_ID }} | ||
| VITE_BUGSNAG_KEY: ${{ secrets.VITE_BUGSNAG_KEY }} | ||
| VITE_FEE_RECIPIENT: ${{ secrets.VITE_FEE_RECIPIENT }} | ||
| VITE_FEE_PAYER_PUB_KEY: ${{ secrets.VITE_FEE_PAYER_PUB_KEY }} | ||
| VITE_FAUCET_MAINNET_API: ${{ secrets.VITE_FAUCET_MAINNET_API }} | ||
| VITE_HOTJAR_KEY: ${{ secrets.VITE_HOTJAR_KEY }} | ||
| VITE_ALCHEMY_KEY: ${{ secrets.VITE_ALCHEMY_KEY }} | ||
| VITE_MIXPANEL_KEY: ${{ secrets.VITE_MIXPANEL_KEY }} | ||
| VITE_TURNKEY_ORGID: ${{ secrets.VITE_TURNKEY_ORGID }} | ||
| VITE_MAGIC_APK_KEY: ${{ secrets.VITE_MAGIC_APK_KEY }} | ||
| VITE_COINGECKO_API_KEY: ${{ secrets.VITE_COINGECKO_API_KEY }} | ||
| VITE_SHEETDB_BEARER_TOKEN: ${{ secrets.VITE_SHEETDB_BEARER_TOKEN }} | ||
| VITE_ONRAMPER_SIGNING_KEY: ${{ secrets.VITE_ONRAMPER_SIGNING_KEY }} | ||
| VITE_ONRAMPER_API_KEY_DEV: ${{ secrets.VITE_ONRAMPER_API_KEY_DEV }} | ||
| VITE_ONRAMPER_API_KEY_PROD: ${{ secrets.VITE_ONRAMPER_API_KEY_PROD }} | ||
| VITE_TURNKEY_GOOGLE_CLIENT_ID: ${{ secrets.VITE_TURNKEY_GOOGLE_CLIENT_ID }} | ||
| VITE_WALLET_CONNECT_PROJECT_ID: ${{ secrets.VITE_WALLET_CONNECT_PROJECT_ID }} | ||
| VITE_GOOGLE_ANALYTICS_KEY: ${{ secrets.VITE_GOOGLE_ANALYTICS_KEY }} | ||
| VITE_GOOGLE_SITE_VERIFICATION_KEY: ${{ secrets.VITE_GOOGLE_SITE_VERIFICATION_KEY }} | ||
| VITE_NEWSLETTER_API: ${{ secrets.VITE_NEWSLETTER_API }} | ||
| VITE_NINJA_PASS_ENDPOINT: ${{ secrets.VITE_NINJA_PASS_ENDPOINT }} | ||
| AWS_REGION: ${{ secrets.AWS_MAINNET_REGION }} | ||
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
| AWS_S3_BUCKET: ${{ secrets.AWS_S3_MAINNET_BUCKET }} | ||
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
| CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.CLOUDFRONT_MAINNET_DISTRIBUTION_ID }} | ||
| VITE_HELIX_MOBILE_CONNECT_SERVER_URL: ${{ secrets.VITE_HELIX_MOBILE_CONNECT_SERVER_URL }} | ||
| NODE_OPTIONS: '--max_old_space_size=30720' | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 100 | ||
| fetch-tags: true | ||
| - name: Using Node ${{ matrix.node-version }} | ||
| uses: useblacksmith/setup-node@v5 | ||
| with: | ||
| node-version-file: '.nvmrc' | ||
| - name: Setup pnpm | ||
| uses: pnpm/action-setup@v4 | ||
| with: | ||
| version: latest | ||
| - name: Get current version | ||
| id: get_version | ||
| run: | | ||
| git fetch --tags | ||
| latest_tag=$(git tag | sort -V | tail -n 1) | ||
| echo "current_version=$latest_tag" >> $GITHUB_ENV | ||
| - name: Generate GitHub Release Notes | ||
| id: release_notes | ||
| uses: InjectiveLabs/github-fe/actions/release-note@master | ||
| with: | ||
| previous_tag: ${{ env.current_version }} | ||
| repo_url: 'https://github.com/InjectiveLabs/injective-helix' | ||
| - name: Create Release | ||
| if: steps.release_notes.outputs.release_notes != 'No new commits' | ||
| id: create_release | ||
| uses: ncipollo/release-action@v1 | ||
| with: | ||
| token: '${{ env.GH_TOKEN }}' | ||
| tag: ${{ steps.release_notes.outputs.new_version }} | ||
| name: Helix Release ${{ steps.release_notes.outputs.new_version }} | ||
| body: | | ||
| ## Changes | ||
| ${{ steps.release_notes.outputs.release_notes }} | ||
| draft: true | ||
| - name: Build app | ||
| run: | | ||
| pnpm install | ||
| pnpm clean-up | ||
| pnpm generate | ||
| env: | ||
| GIT_TAG: ${{ steps.release_notes.outputs.bugsnag_version }} | ||
| - name: Use AWS CLI | ||
| uses: chrislennon/action-aws-cli@v1.1 | ||
| - name: Sync to S3 bucket | ||
| run: aws s3 sync dist/ s3://$AWS_S3_BUCKET/www --follow-symlinks --delete | ||
| - name: Set Cache Headers | ||
| run: aws s3 cp s3://$AWS_S3_BUCKET/www s3://$AWS_S3_BUCKET/www --exclude "*" --include "*.js" --include "*.css" --include "*.svg" --include "*.woff2" --include "*.woff" --include "*.ttf" --recursive --metadata-directive REPLACE --expires 2034-01-01T00:00:00Z --cache-control max-age=2592000,public | ||
| - name: Invalidate Cloudfront CDN | ||
| run: aws cloudfront create-invalidation --distribution-id=$CLOUDFRONT_DISTRIBUTION_ID --paths "/*" | ||
| - name: Publish release | ||
| if: steps.release_notes.outputs.release_notes != 'No new commits' | ||
| uses: StuYarrow/publish-release@v1.1.2 | ||
| env: | ||
| GITHUB_TOKEN: ${{ env.GH_TOKEN }} | ||
| with: | ||
| id: ${{ steps.create_release.outputs.id }} | ||
| - name: Delete draft releases | ||
| if: failure() | ||
| uses: hugo19941994/delete-draft-releases@v1.0.0 | ||
| with: | ||
| threshold: 1s | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
| - name: Upload bugsnag release | ||
| uses: ricado-group/bugsnag-sourcemaps-upload-action@v1 | ||
| with: | ||
| apiKey: ${{ env.VITE_BUGSNAG_KEY }} | ||
| directory: ./.nuxt/dist/client/_nuxt | ||
| baseUrl: ${{ env.VITE_BASE_URL }} | ||
| appVersion: ${{ steps.release_notes.outputs.bugsnag_version }} | ||
| overwrite: true | ||
| outputs: | ||
| release_notes: ${{ steps.release_notes.outputs.release_notes }} | ||
| notify-slack-on-deployment: | ||
| runs-on: blacksmith-4vcpu-ubuntu-2204 | ||
| needs: mainnet-release | ||
| steps: | ||
| - name: 'Notify Slack' | ||
| uses: InjectiveLabs/github-fe/actions/prod-deployment-notification@master | ||
| with: | ||
| project-name: 'Helix' | ||
| webhook-url: ${{ secrets.PRODUCTION_CHANNEL_WEBHOOK_URL }} | ||
| release-notes: ${{ needs.mainnet-release.outputs.release_notes }} | ||