-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Sync Merkl-app * lint
- Loading branch information
Showing
109 changed files
with
2,889 additions
and
1,510 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Trigger production deployment | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+' | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
tag-image: | ||
runs-on: ubuntu-latest | ||
env: | ||
IMAGE_URL: europe-west1-docker.pkg.dev/angle-artifacts/angle-docker-registry/merkl-app | ||
steps: | ||
- uses: 'google-github-actions/auth@v0' | ||
with: | ||
credentials_json: '${{ secrets.GCLOUD_SECRET_ARTIFACTS }}' | ||
- name: Login to Docker | ||
run: gcloud auth configure-docker europe-west1-docker.pkg.dev | ||
- name: Pull and tag image | ||
run: | | ||
export SHORT_SHA=${GITHUB_SHA:0:7} | ||
export VERSION=${GITHUB_REF#refs/tags/} | ||
docker pull $IMAGE_URL:$SHORT_SHA | ||
docker tag $IMAGE_URL:$SHORT_SHA $IMAGE_URL:$VERSION | ||
docker push $IMAGE_URL:$VERSION | ||
trigger-production-deployment: | ||
runs-on: ubuntu-latest | ||
needs: tag-image | ||
steps: | ||
- name: Install dependencies | ||
run: | | ||
sudo snap install yq | ||
- name: Clone deployments repo | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: AngleProtocol/deployments | ||
token: ${{ secrets.ACCESS_TOKEN }} | ||
path: deployments | ||
- name: Modify config.production.yaml and push to deployments | ||
run: | | ||
cd deployments | ||
export VERSION=${GITHUB_REF#refs/tags/} | ||
yq -i '.merkl-app.version = strenv(VERSION)' ./config.production.yaml | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "BaptistG" | ||
git add ./config.production.yaml | ||
git commit -m "Update config.production.yaml with merkl-app version $VERSION" | ||
git push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: Build image and trigger staging deployment | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
build-image: | ||
runs-on: ubuntu-latest | ||
env: | ||
IMAGE_URL: europe-west1-docker.pkg.dev/angle-artifacts/angle-docker-registry/merkl-app | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
token: '${{ secrets.ACCESS_TOKEN }}' | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
- uses: 'google-github-actions/auth@v0' | ||
with: | ||
credentials_json: '${{ secrets.GCLOUD_SECRET_ARTIFACTS }}' | ||
- name: Login to Docker | ||
run: gcloud auth configure-docker europe-west1-docker.pkg.dev | ||
- name: Build image | ||
run: | | ||
export SHORT_SHA=${GITHUB_SHA:0:7} | ||
docker pull $IMAGE_URL:latest || true | ||
docker build --cache-from $IMAGE_URL:latest --tag $IMAGE_URL:$SHORT_SHA --tag $IMAGE_URL:latest . | ||
- name: Push image | ||
run: | | ||
export SHORT_SHA=${GITHUB_SHA:0:7} | ||
docker push $IMAGE_URL:$SHORT_SHA | ||
trigger-staging-deployment: | ||
runs-on: ubuntu-latest | ||
needs: build-image | ||
steps: | ||
- name: Install dependencies | ||
run: | | ||
sudo snap install yq | ||
- name: Clone deployments repo | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: AngleProtocol/deployments | ||
token: ${{ secrets.ACCESS_TOKEN }} | ||
path: deployments | ||
- name: Modify config.staging.yaml and push to deployments | ||
run: | | ||
cd deployments | ||
export SHORT_SHA=${GITHUB_SHA:0:7} | ||
yq -i '.merkl-app.version = strenv(SHORT_SHA)' ./config.staging.yaml | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "BaptistG" | ||
git add ./config.staging.yaml | ||
git commit -m "Update config.staging.yaml with merkl-app version $SHORT_SHA" | ||
git push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule dappkit
updated
19 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const en = { | ||
pages: { | ||
home: { | ||
depositInformation: "", | ||
}, | ||
opportunities: { | ||
title: "Explore opportunities", | ||
description: "Browse opportunities, compare rewards, and earn tokens", | ||
}, | ||
campaings: { | ||
title: "Explore opportunities", | ||
description: "Browse opportunities, compare rewards, and earn tokens", | ||
}, | ||
bridge: { | ||
helper: "", | ||
}, | ||
dashboard: { | ||
explanation: | ||
"Pending rewards are updated approximately every 4 hours, but are claimable onchain once every week.\nIf you don’t claim your rewards from a week, you may always claim them at a later time.", | ||
}, | ||
}, | ||
}; | ||
|
||
export default en; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import en from "./en"; | ||
|
||
type LanguageFiles = typeof en; | ||
|
||
/** | ||
* I18n class to handle translations | ||
*/ | ||
export class I18n { | ||
public static readonly trad: I18n = new I18n(en); | ||
|
||
private primary: LanguageFiles; | ||
// private secondary: LanguageFiles; | ||
|
||
public get: LanguageFiles; | ||
|
||
constructor(primary: LanguageFiles) { | ||
this.primary = primary; | ||
// this.secondary = secondary; | ||
this.get = this.createProxy(this.primary); | ||
} | ||
|
||
// proxy to handle typing autocompletion | ||
private createProxy<T extends object>(obj: T): T { | ||
return new Proxy(obj, { | ||
get: (target, prop) => { | ||
const value = target[prop as keyof T]; | ||
if (typeof value === "object" && value !== null) { | ||
return this.createProxy(value as object); | ||
} | ||
return value; | ||
}, | ||
}); | ||
} | ||
} |
Oops, something went wrong.