Skip to content

Commit

Permalink
chore: deploy un
Browse files Browse the repository at this point in the history
Signed-off-by: Nam Hoang <[email protected]>
  • Loading branch information
namhoang1604 committed Sep 16, 2023
1 parent 14e357f commit 42eb168
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 27 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/build-and-deploy-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ on:
push:
branches:
- dev
- deploy-un
tags:
- '*'

env:
environment: ${{ (github.ref == 'refs/heads/dev' && 'dev') || (startsWith(github.ref, 'refs/tags/v') && 'UN') }}
environment: ${{ (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/deploy-un') && 'UN' || 'dev' }}

jobs:
install_and_build:
Expand All @@ -20,7 +21,9 @@ jobs:
env:
CI: false

environment: ${{ (github.ref == 'refs/heads/dev' && 'dev') || (startsWith(github.ref, 'refs/tags/v') && 'UN') }}
environment:
name: ${{ (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/deploy-un') && 'UN' || 'dev' }}
url: ${{ env.environment == 'UN' && 'https://test.uncefact.org/vckit/explorer/' || 'https://explorer.vckit.showthething.com/' }}

steps:
- name: Checkout repository
Expand All @@ -30,6 +33,10 @@ jobs:
run: |
sudo apt-get -q install -y python3-pip
pip3 install awscli --upgrade --user
- name: Log
run: |
echo ${{ env.environment }}
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v3
Expand Down Expand Up @@ -68,7 +75,9 @@ jobs:
permissions:
id-token: write

environment: ${{ (github.ref == 'refs/heads/dev' && 'dev') || (startsWith(github.ref, 'refs/tags/v') && 'UN') }}
environment:
name: ${{ (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/deploy-un') && 'UN' || 'dev' }}
url: ${{ env.environment == 'UN' && 'https://test.uncefact.org/vckit/explorer/' || 'https://explorer.vckit.showthething.com/' }}

steps:
- name: Checkout repository
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/deploy-to-s3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ on:
push:
branches:
- dev
- deploy-un
tags:
- '*'

env:
environment: ${{ (github.ref == 'refs/heads/dev' && 'dev') || (startsWith(github.ref, 'refs/tags/v') && 'UN') }}
environment: ${{ (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/deploy-un') && 'UN' || 'dev' }}

jobs:
install_and_build:
Expand All @@ -17,7 +18,9 @@ jobs:
env:
CI: false

environment: ${{ (github.ref == 'refs/heads/dev' && 'dev') || (startsWith(github.ref, 'refs/tags/v') && 'UN') }}
environment:
name: ${{ (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/deploy-un') && 'UN' || 'dev' }}
url: ${{ env.environment == 'UN' && 'https://test.uncefact.org/vckit/explorer/' || 'https://explorer.vckit.showthething.com/' }}

steps:
- name: Checkout repository
Expand Down Expand Up @@ -71,7 +74,9 @@ jobs:
permissions:
id-token: write

environment: ${{ (github.ref == 'refs/heads/dev' && 'dev') || (startsWith(github.ref, 'refs/tags/v') && 'UN') }}
environment:
name: ${{ (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/deploy-un') && 'UN' || 'dev' }}
url: ${{ env.environment == 'UN' && 'https://test.uncefact.org/vckit/explorer/' || 'https://explorer.vckit.showthething.com/' }}

steps:
- name: Checkout repository
Expand Down Expand Up @@ -99,6 +104,7 @@ jobs:
if: ${{ env.environment == 'UN' }}
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_ROLE_GITHUB_ACTION_ARN }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
Expand Down
8 changes: 4 additions & 4 deletions packages/demo-explorer/src/layout/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { QueryClientProvider, QueryClient } from 'react-query'
import { ChatProvider } from '../context/ChatProvider'
import { VeramoWeb3Provider } from '../context/web3/VeramoWeb3Provider'


declare global {
interface Window {
BASE_URL: string
Expand All @@ -16,16 +15,17 @@ declare global {

const App = () => {
const queryClient = new QueryClient()
const mode = process.env.REACT_APP_MODE;
const mode = process.env.REACT_APP_MODE
const publicUrl = process.env.PUBLIC_URL

return (
<QueryClientProvider client={queryClient}>
<ThemeProvider>
{
<VeramoWeb3Provider>
<ChatProvider>
<BrowserRouter>
{ mode === 'verifier' ? <VerifierLayout /> : <Layout /> }
<BrowserRouter basename={publicUrl}>
{mode === 'verifier' ? <VerifierLayout /> : <Layout />}
</BrowserRouter>
</ChatProvider>
</VeramoWeb3Provider>
Expand Down
32 changes: 15 additions & 17 deletions packages/demo-explorer/src/layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,19 @@ const Layout = () => {
agent?.context?.name &&
GRAVATAR_URI + md5(agent?.context?.name) + '?s=200&d=retro'

const publicUrl = process.env.PUBLIC_URL;

const mainMenuItems: MenuDataItem = []

if (availableMethods.includes('dataStoreORMGetVerifiableCredentials')) {
mainMenuItems.push({
path: publicUrl + '/statistics',
path: '/statistics',
name: 'Statistics',
// @ts-ignore FIXME: why is ts complaining about this?
icon: <EyeOutlined />,
})
}
if (availableMethods.includes('didManagerFind')) {
mainMenuItems.push({
path: publicUrl + '/managed-identifiers',
path: '/managed-identifiers',
name: 'Managed identifiers',
// @ts-ignore FIXME: why is ts complaining about this?
icon: <UserOutlined />,
Expand All @@ -70,7 +68,7 @@ const Layout = () => {

if (availableMethods.includes('dataStoreORMGetVerifiableCredentials')) {
mainMenuItems.push({
path: publicUrl + '/credentials',
path: '/credentials',
name: 'Credentials',
// @ts-ignore FIXME: why is ts complaining about this?
icon: <SafetyOutlined />,
Expand All @@ -79,13 +77,13 @@ const Layout = () => {

if (availableMethods.includes('dataStoreORMGetMessages')) {
mainMenuItems.push({
path: publicUrl + '/activity',
path: '/activity',
name: 'Activity',
// @ts-ignore FIXME: why is ts complaining about this?
icon: <BarsOutlined />,
})
mainMenuItems.push({
path: publicUrl + '/requests',
path: '/requests',
name: 'Requests',
// @ts-ignore FIXME: why is ts complaining about this?
icon: <InteractionOutlined />,
Expand All @@ -97,15 +95,15 @@ const Layout = () => {
// availableMethods.includes('sendDIDCommMessage')
// ) {
// mainMenuItems.push({
// path: publicUrl + '/chats/threads',
// path: '/chats/threads',
// name: 'DID Chats',
// icon: <MessageOutlined />,
// })
// }

if (availableMethods.includes('dataStoreORMGetIdentifiers')) {
mainMenuItems.push({
path: publicUrl + '/known-identifiers',
path: '/known-identifiers',
name: 'Known identifiers',
// @ts-ignore FIXME: why is ts complaining about this?
icon: <GlobalOutlined />,
Expand All @@ -114,7 +112,7 @@ const Layout = () => {

if (availableMethods.includes('verifyCredential')) {
mainMenuItems.push({
path: publicUrl + '/credential-verifier',
path: '/credential-verifier',
name: 'Credential verifier',
// @ts-ignore FIXME: why is ts complaining about this?
icon: <FileProtectOutlined />,
Expand All @@ -125,37 +123,37 @@ const Layout = () => {

if (agent) {
mainMenuItems.push({
path: publicUrl + '/developer',
path: '/developer',
name: 'Credential issuer',
// @ts-ignore FIXME: why is ts complaining about this?
icon: <CodeOutlined />,
routes: [
// {
// path: publicUrl + '/developer/data-generator',
// path: '/developer/data-generator',
// name: 'Data generator',
// },
{
path: publicUrl + '/developer/credential-from-schema',
path: '/developer/credential-from-schema',
name: 'Issue credential from example',
},
// {
// path: publicUrl + '/developer/issue-profile-credential',
// path: '/developer/issue-profile-credential',
// name: 'Issue profile credential',
// },
// {
// path: publicUrl + '/developer/issue-credential',
// path: '/developer/issue-credential',
// name: 'Issue credential',
// },
{
path: publicUrl + '/developer/create-presentation',
path: '/developer/create-presentation',
name: 'Create presentation',
},
],
})
}

mainMenuItems.push({
path: publicUrl + '/settings',
path: '/settings',
name: 'Settings',
// @ts-ignore FIXME: why is ts complaining about this?
icon: <SettingOutlined />,
Expand Down

0 comments on commit 42eb168

Please sign in to comment.