Merge pull request #1526 from ssvlabs/refactor/remove-bapps #6469
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: Build & deploy | |
| on: | |
| push: | |
| branches: | |
| - "**" | |
| workflow_dispatch: | |
| jobs: | |
| github-workflow: | |
| permissions: | |
| id-token: write | |
| contents: write | |
| issues: write | |
| pull-requests: write | |
| runs-on: ubuntu-latest | |
| env: | |
| STAGE_SSV_NETWORKS: > | |
| [ | |
| { | |
| \"networkId\": 560048, | |
| \"apiVersion\": \"v4\", | |
| \"apiNetwork\": \"hoodi\", | |
| \"api\": \"https://api.stage.ops.ssvlabsinternal.com/api\", | |
| \"explorerUrl\": \"https://explorer.stage.ssv.network\", | |
| \"insufficientBalanceUrl\": \"https://faucet.stage.ssv.network\", | |
| \"googleTagSecret\": \"${{ secrets.STAGE_GOOGLE_TAG_SECRET }}\", | |
| \"tokenAddress\": \"0x746c33ccc28b1363c35c09badaf41b2ffa7e6d56\", | |
| \"bAppContractAddress\": \"0x40d959B95e7c56962D6d388d87921c03734b9C2C\", | |
| \"setterContractAddress\": \"${{ secrets.STAGE_HOODI_NETWORK_SETTER_CONTRACT_ADDRESS_V4 }}\", | |
| \"getterContractAddress\": \"${{ secrets.STAGE_HOODI_NETWORK_GETTER_CONTRACT_ADDRESS_V4 }}\" | |
| } | |
| ] | |
| PROD_SSV_NETWORKS: > | |
| [ | |
| { | |
| \"networkId\": 1, | |
| \"apiVersion\": \"v4\", | |
| \"apiNetwork\": \"mainnet\", | |
| \"api\": \"https://api.ssv.network/api\", | |
| \"explorerUrl\": \"https://explorer.ssv.network\", | |
| \"insufficientBalanceUrl\": \"https://coinmarketcap.com/currencies/ssv-network/#Markets\", | |
| \"googleTagSecret\": \"${{ secrets.PROD_GOOGLE_TAG_SECRET }}\", | |
| \"distributionContract\": \"${{ secrets.PROD_DISTRIBUTION_CONTRACT_ADDRESS_MAINNET }}\", | |
| \"tokenAddress\": \"0x9D65fF81a3c488d585bBfb0Bfe3c7707c7917f54\", | |
| \"setterContractAddress\": \"${{ secrets.PROD_NETWORK_SETTER_CONTRACT_ADDRESS_V4_MAINNET }}\", | |
| \"getterContractAddress\": \"${{ secrets.PROD_NETWORK_GETTER_CONTRACT_ADDRESS_V4_MAINNET }}\" | |
| }, | |
| { | |
| \"networkId\": 560048, | |
| \"apiVersion\": \"v4\", | |
| \"apiNetwork\": \"hoodi\", | |
| \"api\": \"https://api.ssv.network/api\", | |
| \"explorerUrl\": \"https://explorer.ssv.network\", | |
| \"insufficientBalanceUrl\": \"https://faucet.ssv.network\", | |
| \"googleTagSecret\": \"${{ secrets.STAGE_GOOGLE_TAG_SECRET }}\", | |
| \"tokenAddress\": \"0x9F5d4Ec84fC4785788aB44F9de973cF34F7A038e\", | |
| \"bAppContractAddress\": \"0xc7fCFeEc5FB9962bDC2234A7a25dCec739e27f9f\", | |
| \"setterContractAddress\": \"${{ secrets.PROD_HOODI_NETWORK_SETTER_CONTRACT_ADDRESS_V4 }}\", | |
| \"getterContractAddress\": \"${{ secrets.PROD_HOODI_NETWORK_GETTER_CONTRACT_ADDRESS_V4 }}\" | |
| } | |
| ] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v3 | |
| with: | |
| node-version: 20.12.2 | |
| - uses: pnpm/action-setup@v2 | |
| with: | |
| version: 10.20.0 | |
| - uses: actions/cache@v3 | |
| with: | |
| path: ~/.pnpm-store | |
| key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm- | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Run lint | |
| run: pnpm lint | |
| - name: Run semantic-release | |
| if: github.event_name == 'push' && (github.ref == 'refs/heads/stage' || github.ref == 'refs/heads/main') | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: npx semantic-release | |
| - name: Configure AWS credentials | |
| if: github.ref == 'refs/heads/pre-stage' || github.ref == 'refs/heads/stage' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/bapps-prod' | |
| uses: aws-actions/configure-aws-credentials@v3 | |
| with: | |
| role-to-assume: ${{ secrets.SSV_WEB_AWS_IAM_ROLE }} | |
| aws-region: ${{ vars.AWS_REGION }} | |
| # <app-pre.stage.ssv.network> pre-stage | |
| - name: Run stage webapp build | |
| if: github.ref == 'refs/heads/pre-stage' | |
| run: > | |
| GAS_PRICE="${{ env.GAS_PRICE }}" | |
| GAS_LIMIT="${{ env.GAS_LIMIT }}" | |
| SSV_NETWORKS="${{ env.STAGE_SSV_NETWORKS }}" | |
| MIXPANEL_TOKEN_STAGE="${{ secrets.MIXPANEL_TOKEN_STAGE }}" | |
| LINK_SSV_DEV_DOCS="$LINK_SSV_DEV_DOCS" | |
| pnpm build | |
| env: | |
| GAS_PRICE: ${{ secrets.GAS_PRICE }} | |
| GAS_LIMIT: ${{ secrets.GAS_LIMIT }} | |
| LINK_SSV_DEV_DOCS: ${{ secrets.LINK_SSV_DEV_DOCS }} | |
| MIXPANEL_TOKEN: ${{ secrets.MIXPANEL_TOKEN_STAGE }} | |
| - name: Upload files to S3 | |
| if: github.ref == 'refs/heads/pre-stage' | |
| run: | | |
| aws s3 cp ./build s3://${{ secrets.SSV_WEB_PRE_STAGE_AWS_S3_BUCKET }} --recursive | |
| # </app-pre.stage.ssv.network> | |
| # <app.stage.ssv.network> | |
| - name: Run stage webapp build | |
| if: github.ref == 'refs/heads/stage' | |
| run: > | |
| GAS_PRICE="${{ env.GAS_PRICE }}" | |
| GAS_LIMIT="${{ env.GAS_LIMIT }}" | |
| SSV_NETWORKS="${{ env.STAGE_SSV_NETWORKS }}" | |
| MIXPANEL_TOKEN_STAGE="${{ secrets.MIXPANEL_TOKEN_STAGE }}" | |
| LINK_SSV_DEV_DOCS="$LINK_SSV_DEV_DOCS" | |
| pnpm build | |
| env: | |
| GAS_PRICE: ${{ secrets.GAS_PRICE }} | |
| GAS_LIMIT: ${{ secrets.GAS_LIMIT }} | |
| LINK_SSV_DEV_DOCS: ${{ secrets.LINK_SSV_DEV_DOCS }} | |
| MIXPANEL_TOKEN: ${{ secrets.MIXPANEL_TOKEN_STAGE }} | |
| - name: Upload files to S3 | |
| if: github.ref == 'refs/heads/stage' | |
| run: | | |
| aws s3 cp ./build s3://${{ secrets.SSV_WEB_STAGE_AWS_S3_BUCKET }} --recursive | |
| # </app.stage.ssv.network> | |
| # <app.ssv.network> | |
| - name: Run prod webapp build | |
| if: github.ref == 'refs/heads/main' | |
| run: > | |
| GAS_PRICE="${{ env.GAS_PRICE }}" | |
| GAS_LIMIT="${{ env.GAS_LIMIT }}" | |
| SSV_NETWORKS="${{ env.PROD_SSV_NETWORKS }}" | |
| MIXPANEL_TOKEN_PROD="${{ secrets.MIXPANEL_TOKEN_PROD }}" | |
| LINK_SSV_DEV_DOCS="$LINK_SSV_DEV_DOCS" | |
| SENTRY_AUTH_TOKEN="${{ secrets.SENTRY_AUTH_TOKEN }}" | |
| pnpm build | |
| env: | |
| GAS_PRICE: ${{ secrets.GAS_PRICE }} | |
| GAS_LIMIT: ${{ secrets.GAS_LIMIT }} | |
| LINK_SSV_DEV_DOCS: ${{ secrets.LINK_SSV_DEV_DOCS }} | |
| MIXPANEL_TOKEN: ${{ secrets.MIXPANEL_TOKEN_PROD }} | |
| SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
| - name: Upload files to S3 | |
| if: github.ref == 'refs/heads/main' | |
| run: | | |
| aws s3 cp ./build s3://${{ secrets.SSV_WEB_MAIN_AWS_S3_BUCKET }} --recursive | |
| # </app.ssv.network> | |
| # <ba-app.ssv.network> | |
| - name: Run prod ba-app webapp build | |
| if: github.ref == 'refs/heads/bapps-prod' | |
| run: > | |
| GAS_PRICE="${{ env.GAS_PRICE }}" | |
| GAS_LIMIT="${{ env.GAS_LIMIT }}" | |
| SSV_NETWORKS="${{ env.BAPPS_PROD_SSV_NETWORKS }}" | |
| MIXPANEL_TOKEN_PROD="${{ secrets.MIXPANEL_TOKEN_PROD }}" | |
| LINK_SSV_DEV_DOCS="$LINK_SSV_DEV_DOCS" | |
| SENTRY_AUTH_TOKEN="${{ secrets.SENTRY_AUTH_TOKEN }}" | |
| pnpm build | |
| env: | |
| GAS_PRICE: ${{ secrets.GAS_PRICE }} | |
| GAS_LIMIT: ${{ secrets.GAS_LIMIT }} | |
| LINK_SSV_DEV_DOCS: ${{ secrets.LINK_SSV_DEV_DOCS }} | |
| MIXPANEL_TOKEN: ${{ secrets.MIXPANEL_TOKEN_PROD }} | |
| SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
| - name: Upload files to S3 | |
| if: github.ref == 'refs/heads/bapps-prod' | |
| run: | | |
| aws s3 cp ./build s3://${{ secrets.SSV_WEB_BAPP_PROD_AWS_S3_BUCKET }} --recursive | |
| # </ba-app.ssv.network> |