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

Pull source #1

Merged
merged 7 commits into from
Sep 10, 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
2 changes: 1 addition & 1 deletion .github/workflows/e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
file: build/Dockerfile
file: Dockerfile
load: true
tags: onchain-non-merklized-issuer-demo:latest
cache-from: type=gha
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/push-backend-erc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Push onchain non merklized backend to AWS ECR

on:
workflow_dispatch:
push:
branches:
- main

env:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID_PRIVADO_ID }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION_PRIVADO_ID }}
ECR_REPOSITORY: onchain_non_merklized_issuer_backend_demo

jobs:
deploy:
environment:
name: ${{ github.ref_name }}
name: Build and deploy ochain non merklized issuer backend to AWS ECR
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 16

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ env.AWS_DEFAULT_REGION }}
role-to-assume: arn:aws:iam::${{ env.AWS_ACCOUNT_ID }}:role/PolygonIDActionsRole
role-session-name: GitHubActionsSession

- name: Login to Amazon ECR
uses: aws-actions/amazon-ecr-login@v2
id: login-ecr

- name: Get version
run: echo "::set-output name=VERSION::$(git rev-parse --short HEAD)"
id: version

- name: Build with tag and push image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: ${{ env.ECR_REPOSITORY }}
IMAGE_TAG: ${{ steps.version.outputs.VERSION }}
run: |
docker build \
-t ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:latest \
-t ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }} .

docker push ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}
docker push ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:latest
60 changes: 60 additions & 0 deletions .github/workflows/push-frontend-erc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Push onchain non merklized frontend to AWS ECR

on:
workflow_dispatch:
push:
branches:
- main

env:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID_PRIVADO_ID }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION_PRIVADO_ID }}
ECR_REPOSITORY: onchain_non_merklized_issuer_frontend_demo
NEXT_PUBLIC_ISSUER_URL: ${{ vars.NEXT_PUBLIC_ISSUER_URL }}

jobs:
deploy:
environment:
name: ${{ github.ref_name }}
name: Build and deploy ochain non merklized issuer frontend to AWS ECR
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 16

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ env.AWS_DEFAULT_REGION }}
role-to-assume: arn:aws:iam::${{ env.AWS_ACCOUNT_ID }}:role/PolygonIDActionsRole
role-session-name: GitHubActionsSession

- name: Login to Amazon ECR
uses: aws-actions/amazon-ecr-login@v2
id: login-ecr

- name: Get version
run: echo "::set-output name=VERSION::$(git rev-parse --short HEAD)"
id: version

- name: Build with tag and push image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: ${{ env.ECR_REPOSITORY }}
IMAGE_TAG: ${{ steps.version.outputs.VERSION }}
run: |
docker build \
-t ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:latest \
-t ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }} \
--build-arg="NEXT_PUBLIC_ISSUER_URL=${{ env.NEXT_PUBLIC_ISSUER_URL }}" \
-f client/Dockerfile client

docker push ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}
docker push ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:latest
46 changes: 31 additions & 15 deletions client/next.config.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,36 @@
const nextConfig = {
async headers() {
return [
async headers() {
return [
{
source: "/",
headers: [
{
source: '/',
headers: [
{
key: 'Access-Control-Allow-Origin',
value: '*',
}
],
key: "Access-Control-Allow-Origin",
value: "*",
},
]
],
},
publicRuntimeConfig: {
NEXT_PUBLIC_ISSUER_URL: process.env.NEXT_PUBLIC_ISSUER_URL,
},
}
];
},
publicRuntimeConfig: {
NEXT_PUBLIC_ISSUER_URL: process.env.NEXT_PUBLIC_ISSUER_URL,
},

module.exports = nextConfig
webpack: (config, options) => {
const opt = {
...config,
optimization: {
...config.optimization,
splitChunks: false,
// runtimeChunk: false,
// minimize: false,
// emitOnErrors: false,
// usedExports: false
},
};
// console.log(opt);
return opt;
},
};

module.exports = nextConfig;
Loading
Loading