Skip to content

[Build/deploy] connect explorer nextra #48

[Build/deploy] connect explorer nextra

[Build/deploy] connect explorer nextra #48

name: "[Build/deploy] connect explorer nextra"
permissions:
id-token: write # for fetching the OIDC token
contents: read # for actions/checkout
on:
pull_request:
paths:
- "packages/connect/**"
- "packages/connect-common/**"
- "packages/connect-iframe/**"
- "packages/connect-explorer/**"
- "packages/connect-webextension/**"
- "packages/connect-web/**"
- "packages/connect-popup/**"
- "packages/connect-examples/webextension-mv2/**"
- "packages/connect-examples/webextension-mv3/**"
- "packages/connect-explorer-theme/**"
- "packages/connect-explorer-nextra/**"
- "submodules/trezor-common/**"
- "yarn.lock"
- ".github/workflows/template-connect-popup-test-params.yml"
- "docker/docker-connect-popup-ci.sh"
- ".github/workflows/connect-nextra-dev-release.yml"
- ".github/workflows/template-connect-popup-nextra-test-params.yml"
schedule:
# Runs at midnight UTC every day at 01:00 AM CET
- cron: "0 0 * * *"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
DEV_SERVER_HOSTNAME: "dev.suite.sldev.cz"
jobs:
build-deploy:
if: github.repository == 'trezor/trezor-suite'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
# Pull only files needed for connect to save LFS bandwidth
- name: "Pull LFS files for connect"
run: git lfs pull --include "packages/connect-common/files/**/*"
- name: Configure aws credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::538326561891:role/gh_actions_trezor_suite_dev_deploy
aws-region: eu-central-1
- name: Extract branch name
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: Install dependencies
run: |
echo -e "\nenableScripts: false" >> .yarnrc.yml
yarn workspaces focus @trezor/connect-iframe @trezor/connect-web @trezor/connect-popup @trezor/connect-webextension @trezor/connect-explorer-theme @trezor/connect-explorer-nextra
- name: Build connect-web
run: |
yarn workspace @trezor/connect-web build
- name: Build connect-iframe
run: |
yarn workspace @trezor/connect-iframe build
- name: Build connect-popup
run: |
yarn workspace @trezor/connect-popup build
- name: Build connect-webextension
run: |
yarn workspace @trezor/connect-webextension build
- name: Build connect-explorer-theme
run: |
yarn workspace @trezor/connect-explorer-theme build:all
- name: Build connect-explorer
env:
ASSET_PREFIX: /connect-nextra/${{ steps.extract_branch.outputs.branch }}
NODE_ENV: "production"
url: https://${{ env.DEV_SERVER_HOSTNAME }}/connect-nextra/${{ steps.extract_branch.outputs.branch }}
__TREZOR_CONNECT_SRC: https://${{ env.DEV_SERVER_HOSTNAME }}/connect-nextra/${{ steps.extract_branch.outputs.branch }}/
CONNECT_EXPLORER_ASSET_PREFIX: https://${{ env.DEV_SERVER_HOSTNAME }}/connect-nextra/${{ steps.extract_branch.outputs.branch }}
CONNECT_EXPLORER_BASE_PATH: /connect-nextra/${{ steps.extract_branch.outputs.branch }}
run: |
yarn workspace @trezor/connect-explorer-nextra build
- name: Upload connect-explorer-nextra to dev.suite.sldev.cz
env:
DEPLOY_PATH: s3://${{ env.DEV_SERVER_HOSTNAME }}/connect-nextra/${{ steps.extract_branch.outputs.branch }}
run: |
echo "DEPLOY_PATH is set to ${DEPLOY_PATH}"
mkdir -p tmp_build_directory
cp -R ./packages/connect-iframe/build/* tmp_build_directory/
cp -R ./packages/connect-popup/build/* tmp_build_directory/
cp -R ./packages/connect-web/build/* tmp_build_directory/
cp -R ./packages/connect-explorer-nextra/build/* tmp_build_directory/
aws s3 sync --delete tmp_build_directory/ "${DEPLOY_PATH}"
- name: Build connect-explorer-webextension
run: |
yarn workspace @trezor/connect-explorer-nextra build:webextension
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: connect-explorer-nextra-webextension
path: |
packages/connect-explorer-nextra/build-webextension
methods:
needs: [build-deploy]
uses: ./.github/workflows/template-connect-popup-nextra-test-params.yml
with:
test-name: methods.test
DEV_SERVER_HOSTNAME: dev.suite.sldev.cz
run-webextension: false
build-overview: true
popup-close:
needs: [build-deploy]
uses: ./.github/workflows/template-connect-popup-nextra-test-params.yml
with:
test-name: popup-close.test
DEV_SERVER_HOSTNAME: dev.suite.sldev.cz
run-webextension: true
passphrase:
needs: [build-deploy]
uses: ./.github/workflows/template-connect-popup-nextra-test-params.yml
with:
test-name: passphrase.test
DEV_SERVER_HOSTNAME: dev.suite.sldev.cz
# currently flaky, run only in nightly
run-webextension: ${{ github.event_name == 'schedule' }}
popup-pages:
needs: [build-deploy]
uses: ./.github/workflows/template-connect-popup-nextra-test-params.yml
with:
test-name: popup-pages.test
DEV_SERVER_HOSTNAME: dev.suite.sldev.cz
browser-support:
needs: [build-deploy]
uses: ./.github/workflows/template-connect-popup-nextra-test-params.yml
with:
test-name: browser-support.test
DEV_SERVER_HOSTNAME: dev.suite.sldev.cz
permissions:
needs: [build-deploy]
uses: ./.github/workflows/template-connect-popup-nextra-test-params.yml
with:
test-name: permissions.test
DEV_SERVER_HOSTNAME: dev.suite.sldev.cz
transport:
needs: [build-deploy]
uses: ./.github/workflows/template-connect-popup-nextra-test-params.yml
with:
test-name: transport.test
DEV_SERVER_HOSTNAME: dev.suite.sldev.cz
unchained:
needs: [build-deploy]
uses: ./.github/workflows/template-connect-popup-nextra-test-params.yml
with:
test-name: unchained.test
DEV_SERVER_HOSTNAME: dev.suite.sldev.cz
run-web: ${{ github.event_name == 'schedule' }}