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 17555b6
Show file tree
Hide file tree
Showing 3 changed files with 69 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
69 changes: 48 additions & 21 deletions packages/demo-explorer/src/layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const Layout = () => {
agent?.context?.name &&
GRAVATAR_URI + md5(agent?.context?.name) + '?s=200&d=retro'

const publicUrl = process.env.PUBLIC_URL;
const publicUrl = process.env.PUBLIC_URL

const mainMenuItems: MenuDataItem = []

Expand Down Expand Up @@ -209,33 +209,60 @@ const Layout = () => {
}}
>
<Routes>
<Route path="/connect" element={<Connect />} />
<Route path="/agents" element={<Agents />} />
<Route path="/agent/:id" element={<Agent />} />
<Route path="/chats/threads/:threadId" element={<Chats />} />
<Route path="/chats/threads" element={<Chats />} />
<Route path="/statistics" element={<Statistics />} />
<Route path="/known-identifiers" element={<KnownIdentifiers />} />
<Route path="/managed-identifiers" element={<ManagedIdentifiers />} />
<Route path="/identifier/:id" element={<Identifier />} />
<Route path="/credentials" element={<Credentials />} />
<Route path="/credential/:id" element={<Credential />} />
<Route path="/activity" element={<Activity />} />
<Route path="/credential-verifier" element={<CredentialVerifier />} />
<Route path="/requests" element={<Requests />} />
<Route path="/requests/sdr/:messageId" element={<CreateResponse />} />
<Route path="/developer/data-generator" element={<DataGenerator />} />
<Route path={publicUrl + '/connect'} element={<Connect />} />
<Route path={publicUrl + '/agents'} element={<Agents />} />
<Route path={publicUrl + '/agent/:id'} element={<Agent />} />
<Route
path="/developer/credential-from-schema"
path={publicUrl + '/chats/threads/:threadId'}
element={<Chats />}
/>
<Route path={publicUrl + '/chats/threads'} element={<Chats />} />
<Route path={publicUrl + '/statistics'} element={<Statistics />} />
<Route
path={publicUrl + '/known-identifiers'}
element={<KnownIdentifiers />}
/>
<Route
path={publicUrl + '/managed-identifiers'}
element={<ManagedIdentifiers />}
/>
<Route
path={publicUrl + '/identifier/:id'}
element={<Identifier />}
/>
<Route path={publicUrl + '/credentials'} element={<Credentials />} />
<Route
path={publicUrl + '/credential/:id'}
element={<Credential />}
/>
<Route path={publicUrl + '/activity'} element={<Activity />} />
<Route
path={publicUrl + '/credential-verifier'}
element={<CredentialVerifier />}
/>
<Route path={publicUrl + '/requests'} element={<Requests />} />
<Route
path={publicUrl + '/requests/sdr/:messageId'}
element={<CreateResponse />}
/>
<Route
path={publicUrl + '/developer/data-generator'}
element={<DataGenerator />}
/>
<Route
path={publicUrl + '/developer/credential-from-schema'}
element={<SelectSchemaAndIssue />}
/>
<Route
path="/developer/create-presentation"
path={publicUrl + '/developer/create-presentation'}
element={<CreatePresentation />}
/>
<Route path="/settings" element={<Settings />} />
<Route path={publicUrl + '/settings'} element={<Settings />} />
{!agent && (
<Route path="/" element={<Navigate replace to="/connect" />} />
<Route
path={publicUrl + '/'}
element={<Navigate replace to="/connect" />}
/>
)}
</Routes>
</ProLayout>
Expand Down

0 comments on commit 17555b6

Please sign in to comment.