Skip to content

feat: add tx history balance changes #1396

feat: add tx history balance changes

feat: add tx history balance changes #1396

Workflow file for this run

name: Console CI/CD
on:
push:
paths-ignore:
- 'apps/dashboard/**'
- 'deploy/helm/dashboard/**'
- ".github/workflows/ci.yaml"
- 'apps/sandbox/**'
- 'deploy/helm/sandbox/**'
- ".github/workflows/sandbox-ci.yaml"
branches:
- main
pull_request:
paths-ignore:
- 'apps/dashboard/**'
- 'deploy/helm/dashboard/**'
- ".github/workflows/ci.yaml"
- 'apps/sandbox/**'
- 'deploy/helm/sandbox/**'
- ".github/workflows/sandbox-ci.yaml"
branches:
- main
release:
types:
- prereleased
- released
workflow_dispatch:
inputs:
ENVIRONMENT_NAME:
description: 'Environment Name'
required: true
default: enkinet
type: choice
options:
- enkinet
- hammunet
- gilganet
- mardunet
env:
active_network: 'stokenet'
prerelease_network: 'stokenet'
release_network: 'mainnet'
permissions:
id-token: write
pull-requests: read
contents: read
deployments: write
jobs:
trigger:
name: Check trigger
if: >
( github.event.action == 'prereleased' && contains( github.event.release.tag_name, 'console') ) ||
( github.event.action == 'released' && contains( github.event.release.tag_name, 'console') ) ||
( github.event_name == 'workflow_dispatch' ) ||
( github.ref == 'refs/heads/main' && github.event_name == 'push') ||
( github.event_name == 'pull_request' )
runs-on: ubuntu-latest
steps:
- name: Dump context
uses: crazy-max/ghaction-dump-context@v2
- name: Info
run: |
echo "This is triggered by ${{ github.event_name }}." >> $GITHUB_STEP_SUMMARY
echo "Github action is ${{ github.event.action }}." >> $GITHUB_STEP_SUMMARY
build:
runs-on: ubuntu-latest
needs:
- trigger
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
with:
fetch-depth: 0
- name: Dump context
uses: crazy-max/ghaction-dump-context@158bbf4d6158a44a7e13f76295dc55a69e481a6e
- uses: ./.github/actions/build
with:
active_network_name: ${{ env.active_network }}
release_network_name: ${{ env.release_network }}
- name: Turbo Worfkflow
run: npx turbo run lint prettier coverage svelte:check --filter=console
setup-tags:
runs-on: ubuntu-latest
needs:
- trigger
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
with:
fetch-depth: 0
- name: Docker tags for console
id: console-tags
uses: docker/metadata-action@v4
with:
images: |
docker.io/radixdlt/dapps-console
tags: |
type=sha,event=pr
type=sha,event=branch
type=semver,pattern={{version}}
- name: Define network name
run: |
if [ "${{ github.event_name}}" = 'workflow_dispatch' ]; then
echo "NETWORK_NAME="${{ github.event.inputs.ENVIRONMENT_NAME }}"" >> $GITHUB_ENV
elif [ "${{ github.event.action }}" = "released" ]; then
echo "NETWORK_NAME=${{ env.release_network }}" >> $GITHUB_ENV
elif [ "${{ github.event.action }}" = "prereleased" ]; then
echo "NETWORK_NAME=${{ env.prerelease_network }}" >> $GITHUB_ENV
elif [ "${{ github.ref }}" = "refs/heads/main" -a "${{ github.event_name }}" = 'push' ] || [ "${{ github.event_name }}" = "pull_request" ]; then
echo "NETWORK_NAME=${{ env.active_network }}" >> $GITHUB_ENV
fi
- id: network
run: |
echo "network-name=${{ env.NETWORK_NAME }}" >> $GITHUB_OUTPUT
- id: tag-with-network
run: |
echo "tag-with-network=${{github.sha}}-${{ env.NETWORK_NAME }}" >> $GITHUB_OUTPUT
- run: |
echo "$GITHUB_OUTPUT"
outputs:
console-tags: ${{ steps.console-tags.outputs.tags }}
console-labels: ${{ steps.console-tags.outputs.labels }}
console-json: ${{ steps.console-tags.outputs.json }}
tag-with-network: ${{steps.tag-with-network.outputs.tag-with-network}}
network-name: ${{steps.network.outputs.network-name}}
snyk-scan-deps-licences:
runs-on: ubuntu-latest
needs:
- trigger
steps:
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
- uses: radixdlt/public-iac-resuable-artifacts/fetch-secrets@main
with:
role_name: 'arn:aws:iam::308190735829:role/gh-common-secrets-read-access'
app_name: 'console'
step_name: 'snyk-scan-deps-licenses'
secret_prefix: 'SNYK'
secret_name: 'arn:aws:secretsmanager:eu-west-2:308190735829:secret:github-actions/common/snyk-credentials-rXRpuX'
parse_json: true
- name: Run Snyk to check for deps vulnerabilities
uses: snyk/actions/node@b98d498629f1c368650224d6d212bf7dfa89e4bf # v0.4.0
with:
args: --all-projects --org=${{ env.SNYK_PROJECTS_ORG_ID }} --severity-threshold=critical
snyk-scan-code:
runs-on: ubuntu-latest
needs:
- trigger
steps:
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
- uses: radixdlt/public-iac-resuable-artifacts/fetch-secrets@main
with:
role_name: 'arn:aws:iam::308190735829:role/gh-common-secrets-read-access'
app_name: 'console'
step_name: 'snyk-scan-code'
secret_prefix: 'SNYK'
secret_name: 'arn:aws:secretsmanager:eu-west-2:308190735829:secret:github-actions/common/snyk-credentials-rXRpuX'
parse_json: true
- name: Run Snyk to check for code vulnerabilities
uses: snyk/actions/node@b98d498629f1c368650224d6d212bf7dfa89e4bf # v0.4.0
continue-on-error: true # temporary until code fix
with:
args: --all-projects --org=${{ env.SNYK_PROJECTS_ORG_ID }} --severity-threshold=high
command: code test
snyk-sbom:
runs-on: ubuntu-latest
permissions: write-all
needs:
- snyk-scan-deps-licences
- snyk-scan-code
steps:
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
- uses: radixdlt/public-iac-resuable-artifacts/fetch-secrets@main
with:
role_name: 'arn:aws:iam::308190735829:role/gh-common-secrets-read-access'
app_name: 'console'
step_name: 'snyk-sbom'
secret_prefix: 'SNYK'
secret_name: 'arn:aws:secretsmanager:eu-west-2:308190735829:secret:github-actions/common/snyk-credentials-rXRpuX'
parse_json: true
- name: Generate SBOM # check SBOM can be generated but nothing is done with it
uses: snyk/actions/node@b98d498629f1c368650224d6d212bf7dfa89e4bf # v0.4.0
with:
args: --all-projects --org=${{ env.SNYK_PROJECTS_ORG_ID }} --format=cyclonedx1.4+json --json-file-output sbom.json
command: sbom
- name: Upload SBOM
if: github.event_name == 'release'
uses: AButler/upload-release-assets@c94805dc72e4b20745f543da0f62eaee7722df7a # v2.0.2
with:
files: sbom.json
repo-token: ${{ secrets.GITHUB_TOKEN }}
release-tag: ${{ github.event.release.tag_name }}
snyk-monitor:
runs-on: ubuntu-latest
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop')
needs:
- setup-tags
- push-console
steps:
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
- uses: radixdlt/public-iac-resuable-artifacts/fetch-secrets@main
with:
role_name: 'arn:aws:iam::308190735829:role/gh-common-secrets-read-access'
app_name: 'console'
step_name: 'snyk-monitor'
secret_prefix: 'SNYK'
secret_name: 'arn:aws:secretsmanager:eu-west-2:308190735829:secret:github-actions/common/snyk-credentials-rXRpuX'
parse_json: true
- name: Enable Snyk online monitoring to check for vulnerabilities
uses: snyk/actions/node@b98d498629f1c368650224d6d212bf7dfa89e4bf # v0.4.0
with:
args: --all-projects --org=${{ env.SNYK_PROJECTS_ORG_ID }} --target-reference=${{ github.ref_name }}
command: monitor
snyk-container-monitor:
runs-on: ubuntu-latest
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop')
needs:
- setup-tags
- push-console
steps:
- uses: radixdlt/public-iac-resuable-artifacts/snyk-container-monitor@main
with:
role_name: 'arn:aws:iam::308190735829:role/gh-common-secrets-read-access'
app_name: 'console'
dockerhub_secret_name: 'arn:aws:secretsmanager:eu-west-2:308190735829:secret:github-actions/common/dockerhub-credentials'
snyk_secret_name: 'arn:aws:secretsmanager:eu-west-2:308190735829:secret:github-actions/common/snyk-credentials-rXRpuX'
snyk_org_id: ${{ secrets.SNYK_ORG_ID }}
image: docker.io/radixdlt/dapps-console:${{ needs.setup-tags.outputs.tag-with-network }}
target_ref: ${{ github.ref_name }}
sonar:
runs-on: ubuntu-latest
needs:
- trigger
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
with:
always-auth: true
node-version: 20.3.0
- uses: radixdlt/public-iac-resuable-artifacts/fetch-secrets@main
with:
role_name: 'arn:aws:iam::308190735829:role/gh-dapps-monorepo-secrets-read-access'
app_name: 'console'
step_name: 'sonar'
secret_prefix: 'GH'
secret_name: 'arn:aws:secretsmanager:eu-west-2:308190735829:secret:github-actions/radixdlt/dapps-monorepo/console/sonar-token-xXTI1Y'
parse_json: true
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
with:
projectBaseDir: ./apps/console
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ env.GH_SONAR_TOKEN }}
push-console:
runs-on: ubuntu-latest
needs:
- setup-tags
- snyk-scan-deps-licences
- snyk-scan-code
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
- uses: radixdlt/public-iac-resuable-artifacts/fetch-secrets@main
with:
role_name: 'arn:aws:iam::308190735829:role/gh-common-secrets-read-access'
app_name: 'console'
step_name: 'push-console'
secret_prefix: 'DOCKERHUB_PRIVATE'
secret_name: 'arn:aws:secretsmanager:eu-west-2:308190735829:secret:github-actions/common/dockerhub-credentials'
parse_json: true
- name: Login to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{env.DOCKERHUB_PRIVATE_USERNAME}}
password: ${{env.DOCKERHUB_PRIVATE_TOKEN}}
# - name: Restore yarn cache
# uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
# with:
# node-version: 20.3.0
# cache: npm
# - name: Copy cache locally
# run: cp -R $HOME/.cache .cache
- name: Docker build and push
uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5
with:
file: ./Dockerfile
push: true
context: .
tags: docker.io/radixdlt/dapps-console:${{ needs.setup-tags.outputs.tag-with-network }}
labels: ${{ needs.setup-tags.outputs.console-labels }}
target: 'console'
build-args: |
NETWORK_NAME=${{ needs.setup-tags.outputs.network-name }}
NPM_LOCAL_CACHE=.cache/
- uses: radixdlt/public-iac-resuable-artifacts/fetch-secrets@main
with:
role_name: 'arn:aws:iam::308190735829:role/gh-common-secrets-read-access'
app_name: 'console'
step_name: 'push-console'
secret_prefix: 'SNYK'
secret_name: 'arn:aws:secretsmanager:eu-west-2:308190735829:secret:github-actions/common/snyk-credentials-rXRpuX'
parse_json: true
- name: Snyk image scan
uses: snyk/actions/docker@b98d498629f1c368650224d6d212bf7dfa89e4bf # v0.4.0
with:
image: docker.io/radixdlt/dapps-console:${{ needs.setup-tags.outputs.tag-with-network }}
args: --file=Dockerfile --severity-threshold=critical --fail-on=all
- name: Docker Image output
run: docker images
- name: Output job summary
run: |
echo "Network that will be deployed: ${{ needs.setup-tags.outputs.network-name }}" >> $GITHUB_STEP_SUMMARY
deploy_pull_request:
if: ${{ github.event.pull_request }}
uses: radixdlt/iac-resuable-artifacts/.github/workflows/[email protected]
needs:
- push-console
- setup-tags
with:
env_name: pr
hierarchical_namespace: dapps-console-ci-pr
namespace: dapps-console-pr-${{ github.event.number }}
restart_pods: false
create_subns: true
aws_region: eu-west-2
role_to_assume: arn:aws:iam::308190735829:role/gh-dapps-console-pr-deployer
eks_cluster: rdx-works-main-dev
helm_folder: deploy/helm/console
helmfile_extra_vars: >-
ci.tag=${{ needs.setup-tags.outputs.tag-with-network }},
ci.prNumber=${{ github.event.number }},
ci.environment=pr
app_name: 'console'
step_name: 'deploy-pr'
deploy_dev:
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
uses: radixdlt/iac-resuable-artifacts/.github/workflows/[email protected]
needs:
- push-console
- setup-tags
with:
env_name: dev
namespace: dapps-console-dev
restart_pods: false
create_subns: false
aws_region: eu-west-2
role_to_assume: arn:aws:iam::308190735829:role/gh-dapps-console-dev-deployer
eks_cluster: rdx-works-main-dev
helm_folder: deploy/helm/console
helmfile_extra_vars: >-
ci.tag=${{ needs.setup-tags.outputs.tag-with-network }}
app_name: 'console'
step_name: 'deploy-dev'
deploy_enkinet:
if: >
( github.event.inputs.ENVIRONMENT_NAME == 'enkinet' && github.event_name == 'workflow_dispatch' )
uses: radixdlt/iac-resuable-artifacts/.github/workflows/[email protected]
needs:
- push-console
- setup-tags
with:
env_name: enkinet
namespace: dapps-console-enkinet
restart_pods: false
create_subns: false
aws_region: eu-west-2
role_to_assume: 'arn:aws:iam::308190735829:role/gh-dapps-console-dev-deployer'
eks_cluster: rdx-works-main-dev
helm_folder: deploy/helm/console
helmfile_extra_vars: >-
ci.tag=${{ needs.setup-tags.outputs.tag-with-network }}
github_environment: console-enkinet
app_name: 'console'
step_name: 'deploy-enkinet'
deploy_hammunet:
if: >
( github.event.inputs.ENVIRONMENT_NAME == 'hammunet' && github.event_name == 'workflow_dispatch' )
uses: radixdlt/iac-resuable-artifacts/.github/workflows/[email protected]
needs:
- push-console
- setup-tags
with:
env_name: hammunet
namespace: dapps-console-hammunet
restart_pods: false
create_subns: false
aws_region: eu-west-2
role_to_assume: 'arn:aws:iam::308190735829:role/gh-dapps-console-dev-deployer'
eks_cluster: rdx-works-main-dev
helm_folder: deploy/helm/console
helmfile_extra_vars: >-
ci.tag=${{ needs.setup-tags.outputs.tag-with-network }}
github_environment: console-hammunet
app_name: 'console'
step_name: 'deploy-hammunet'
deploy_gilganet:
if: >
( github.event.inputs.ENVIRONMENT_NAME == 'gilganet' && github.event_name == 'workflow_dispatch' )
uses: radixdlt/iac-resuable-artifacts/.github/workflows/[email protected]
needs:
- push-console
- setup-tags
with:
env_name: gilganet
namespace: dapps-console-gilganet
restart_pods: false
create_subns: false
aws_region: eu-west-2
role_to_assume: 'arn:aws:iam::308190735829:role/gh-dapps-console-dev-deployer'
eks_cluster: rdx-works-main-dev
helm_folder: deploy/helm/console
helmfile_extra_vars: >-
ci.tag=${{ needs.setup-tags.outputs.tag-with-network }}
github_environment: console-gilganet
app_name: 'console'
step_name: 'deploy-gilganet'
deploy_mardunet:
if: >
( github.event.inputs.ENVIRONMENT_NAME == 'mardunet' && github.event_name == 'workflow_dispatch' )
uses: radixdlt/iac-resuable-artifacts/.github/workflows/[email protected]
needs:
- push-console
- setup-tags
with:
env_name: mardunet
namespace: dapps-console-mardunet
restart_pods: false
create_subns: false
aws_region: eu-west-2
role_to_assume: 'arn:aws:iam::308190735829:role/gh-dapps-console-dev-deployer'
eks_cluster: rdx-works-main-dev
helm_folder: deploy/helm/console
helmfile_extra_vars: >-
ci.tag=${{ needs.setup-tags.outputs.tag-with-network }}
github_environment: console-mardunet
app_name: 'console'
step_name: 'deploy-mardunet'
deploy_stokenet:
if: github.event_name == 'release' && github.event.action == 'prereleased'
uses: radixdlt/iac-resuable-artifacts/.github/workflows/[email protected]
needs:
- push-console
- setup-tags
with:
env_name: stokenet
restart_pods: false
namespace: dapps-console-stokenet
create_subns: false
aws_region: eu-west-2
role_to_assume: 'arn:aws:iam::821496737932:role/gh-dapps-console-stokenet-deployer'
eks_cluster: rtlj-prod
helm_folder: deploy/helm/console
helmfile_extra_vars: >-
ci.tag=${{ needs.setup-tags.outputs.tag-with-network }}
github_environment: console-stokenet
app_name: 'console'
step_name: 'deploy-stokenet'
deploy_mainnet:
if: github.event_name == 'release' && github.event.action == 'released'
uses: radixdlt/iac-resuable-artifacts/.github/workflows/[email protected]
needs:
- push-console
- setup-tags
with:
env_name: mainnet
restart_pods: false
namespace: dapps-console-mainnet
create_subns: false
aws_region: eu-west-2
role_to_assume: 'arn:aws:iam::821496737932:role/gh-dapps-console-mainnet-deployer'
eks_cluster: rtlj-prod
helm_folder: deploy/helm/console
helmfile_extra_vars: >-
ci.tag=${{ needs.setup-tags.outputs.tag-with-network }}
github_environment: console-mainnet
app_name: 'console'
step_name: 'deploy-mainnet'