mirror of
https://github.com/trezor/trezor-suite.git
synced 2026-03-03 05:55:03 +01:00
65 lines
2.0 KiB
YAML
65 lines
2.0 KiB
YAML
name: "Reusable Build Suite Web for E2E tests"
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
instrument-code:
|
|
description: "Enables Istanbul plugin for Babel to instrument the code for coverage reporting"
|
|
required: false
|
|
default: "false"
|
|
type: string
|
|
|
|
jobs:
|
|
build-web:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
id-token: write # required for aws-actions/configure-aws-credentials
|
|
contents: read
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha || github.sha }}
|
|
|
|
- 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
|
|
id: extract_branch
|
|
shell: bash
|
|
run: |
|
|
echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_ENV
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version-file: ".nvmrc"
|
|
cache: yarn
|
|
|
|
- name: Install dependencies
|
|
shell: bash
|
|
run: |
|
|
echo -e "\nenableScripts: false" >> .yarnrc.yml
|
|
echo -e "\nenableHardenedMode: false" >> .yarnrc.yml
|
|
yarn workspaces focus @trezor/suite-web @trezor/suite-data @trezor/suite-build
|
|
|
|
- name: Build Suite Web
|
|
shell: bash
|
|
env:
|
|
ASSET_PREFIX: /suite-web/${{ env.branch }}/web
|
|
DESKTOP_APP_NAME: "Trezor-Suite"
|
|
INSTRUMENT_CODE: ${{ inputs.instrument-code }}
|
|
run: |
|
|
yarn message-system-sign-config
|
|
yarn workspace @trezor/suite-data build:lib
|
|
yarn workspace @trezor/suite-web build
|
|
|
|
- name: Upload Suite Web to S3
|
|
shell: bash
|
|
env:
|
|
DEPLOY_PATH: s3://dev.suite.sldev.cz/suite-web/${{ env.branch }}
|
|
run: |
|
|
aws s3 sync --delete ./packages/suite-web/build ${DEPLOY_PATH}/web
|