[Build/deploy] connect explorer nextra #40
This file contains 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] connect explorer nextra" | |
permissions: | |
id-token: write # for fetching the OIDC token | |
contents: read # for actions/checkout | |
on: | |
pull_request: | |
paths: | |
- "packages/connect-explorer-theme/**" | |
- "packages/connect-explorer-nextra/**" | |
- ".github/workflows/connect-nextra-dev-release.yml" | |
schedule: | |
# Runs at midnight UTC every day at 01:00 AM CET | |
- cron: "0 0 * * *" | |
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: | | |
yarn install --immutable | |
yarn build:libs | |
- 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 |