Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(wallet-dashboard): Improve release process #4537

Merged
merged 6 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/_vercel_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,16 @@ jobs:
secrets: inherit
with:
isProd: false
isStaging: false

wallet-dashboard-prod:
name: Vercel Wallet Dashboard Production
wallet-dashboard-staging:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reminder that this will need an update of the confluence page 🙏🏻

name: Vercel Wallet Dashboard Staging
if: github.ref_name == 'develop'
uses: ./.github/workflows/apps_wallet_dashboard_deploy.yml
secrets: inherit
with:
isProd: true
isProd: false
isStaging: true

apps-backend-preview:
name: Vercel apps-backend Preview
Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/apps_wallet_dashboard_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,25 @@ name: Deploy for Wallet Dashboard
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.WALLET_DASHBOARD_VERCEL_PROJECT_ID }}
WALLET_DASHBOARD_VERCEL_PROJECT_STAGING_URL: ${{ secrets.WALLET_DASHBOARD_VERCEL_PROJECT_STAGING_URL }}

on:
workflow_dispatch:
inputs:
isProd:
type: boolean
required: true
isStaging:
type: boolean
required: true
workflow_call:
inputs:
isProd:
type: boolean
required: true
isStaging:
type: boolean
required: true

jobs:
deploy:
Expand Down Expand Up @@ -64,8 +75,11 @@ jobs:
id: deploy_url
if: ${{ inputs.isProd == false }}
run: echo "DEPLOY_URL=$(cat vercel_output.txt | awk 'END{print}')" >> $GITHUB_OUTPUT
- name: Alias Staging deploy
if: ${{ inputs.isStaging }}
run: vercel alias ${{ steps.deploy_url.outputs.DEPLOY_URL }} $WALLET_DASHBOARD_VERCEL_PROJECT_STAGING_URL --token=${{ secrets.VERCEL_TOKEN }} --scope=${{ secrets.VERCEL_SCOPE }}
- name: Comment on pull request
if: ${{ inputs.isProd == false }}
if: ${{ inputs.isProd == false && inputs.isStaging == false }}
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
4 changes: 3 additions & 1 deletion apps/wallet-dashboard/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ function HomeDashboardPage(): JSX.Element {
<ConnectButton connectText="Connect" />
</div>
</div>
<div className="text-body-lg text-neutral-60">
<div className="text-center text-body-lg text-neutral-60">
&copy; IOTA Foundation {CURRENT_YEAR}
<br />
{process.env.NEXT_PUBLIC_DASHBOARD_REV}
</div>
</div>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,21 @@ export function SettingsListView({ handleClose, setView }: SettingsListViewProps
<DialogLayout>
<Header title="Settings" onClose={handleClose} onBack={handleClose} titleCentered />
<DialogLayoutBody>
<div className="flex w-full flex-col gap-md">
{MENU_ITEMS.map((item, index) => (
<Card key={index} type={CardType.Default} onClick={item.onClick}>
<CardImage type={ImageType.BgSolid}>
<div className="flex h-10 w-10 items-center justify-center rounded-full text-neutral-10 dark:text-neutral-92 [&_svg]:h-5 [&_svg]:w-5">
<span className="text-2xl">{item.icon}</span>
</div>
</CardImage>
<CardBody title={item.title} subtitle={item.subtitle} />
<CardAction type={CardActionType.Link} />
</Card>
))}
<div className="flex h-full flex-col content-stretch">
<div className="flex h-full w-full flex-col gap-md">
{MENU_ITEMS.map((item, index) => (
<Card key={index} type={CardType.Default} onClick={item.onClick}>
<CardImage type={ImageType.BgSolid}>
<div className="flex h-10 w-10 items-center justify-center rounded-full text-neutral-10 dark:text-neutral-92 [&_svg]:h-5 [&_svg]:w-5">
<span className="text-2xl">{item.icon}</span>
</div>
</CardImage>
<CardBody title={item.title} subtitle={item.subtitle} />
<CardAction type={CardActionType.Link} />
</Card>
))}
</div>
<p className="text-center">{process.env.NEXT_PUBLIC_DASHBOARD_REV}</p>
</div>
</DialogLayoutBody>
</DialogLayout>
Expand Down
6 changes: 6 additions & 0 deletions apps/wallet-dashboard/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// Copyright (c) 2024 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

import { execSync } from 'child_process';
const NEXT_PUBLIC_DASHBOARD_REV = execSync('git rev-parse HEAD').toString().trim().toString();

/** @type {import('next').NextConfig} */
const nextConfig = {
async redirects() {
Expand All @@ -16,6 +19,9 @@ const nextConfig = {
// Remove this domain when fetching data
domains: ['d315pvdvxi2gex.cloudfront.net'],
},
env: {
NEXT_PUBLIC_DASHBOARD_REV,
},
};

export default nextConfig;
Loading