Skip to content

Commit

Permalink
🔀 Merge branch 'deploy/main' into feature/get-token
Browse files Browse the repository at this point in the history
  • Loading branch information
AuroraHuang22 committed Sep 26, 2024
2 parents 3c503f2 + c407696 commit e6206c3
Show file tree
Hide file tree
Showing 14 changed files with 466 additions and 43 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,17 @@ on:
branches:
- 'deploy/main'

env:
PROJECT_ID: ${{ secrets.GKE_PROJECT }}
GKE_CLUSTER: ${{ secrets.GKE_CLUSTER }}
GKE_ZONE: ${{ secrets.GKE_ZONE }}
DEPLOYMENT_NAME: ${{ secrets.DEPLOYMENT_NAME }}
IMAGE: ${{ secrets.GCR_IMAGE }}
GA_TRACKING_ID: ${{ secrets.GA_TRACKING_ID }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}

jobs:
setup-build-publish-deploy:
name: Setup, Build, Publish, and Deploy
runs-on: ubuntu-latest
environment: production

env:
PROJECT_ID: ${{ secrets.GKE_PROJECT }}
GKE_CLUSTER: ${{ secrets.GKE_CLUSTER }}
GKE_ZONE: ${{ secrets.GKE_ZONE }}
DEPLOYMENT_NAME: ${{ secrets.DEPLOYMENT_NAME }}
IMAGE: ${{ secrets.GCR_IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@master
Expand Down Expand Up @@ -56,8 +52,12 @@ jobs:
build-args: |
"GITHUB_SHA=${{ github.sha }}"
"GITHUB_REF=${{ github.ref }}"
"GA_TRACKING_ID=${{ env.GA_TRACKING_ID }}"
"SENTRY_DSN=${{ env.SENTRY_DSN }}"
"GA_TRACKING_ID=${{ secrets.GA_TRACKING_ID }}"
"RELEASE=${{ github.sha }}"
"SENTRY_DSN=${{ vars.SENTRY_DSN }}"
"SENTRY_ORG=${{ vars.SENTRY_ORG }}"
"SENTRY_PROJECT=${{ vars.SENTRY_PROJECT }}"
"SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}"
# Deploy the Docker image to the GKE cluster
- name: Deploy
Expand Down
21 changes: 12 additions & 9 deletions .github/workflows/deploy-rinkeby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,18 @@ on:
branches:
- 'deploy/rinkeby'

env:
PROJECT_ID: ${{ secrets.GKE_PROJECT }}
GKE_CLUSTER: ${{ secrets.GKE_CLUSTER }}
GKE_ZONE: ${{ secrets.GKE_ZONE }}
DEPLOYMENT_NAME: ${{ secrets.DEPLOYMENT_NAME }}
IMAGE: ${{ secrets.GCR_IMAGE }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
IS_TESTNET: 'TRUE'

jobs:
setup-build-publish-deploy:
name: Setup, Build, Publish, and Deploy
runs-on: ubuntu-latest
environment: rinkeby
env:
PROJECT_ID: ${{ secrets.GKE_PROJECT }}
GKE_CLUSTER: ${{ secrets.GKE_CLUSTER }}
GKE_ZONE: ${{ secrets.GKE_ZONE }}
DEPLOYMENT_NAME: ${{ secrets.DEPLOYMENT_NAME }}
IMAGE: ${{ secrets.GCR_IMAGE }}
IS_TESTNET: 'TRUE'

steps:
- name: Checkout
Expand Down Expand Up @@ -57,6 +55,11 @@ jobs:
"IS_TESTNET=${{ env.IS_TESTNET }}"
"GITHUB_SHA=${{ github.sha }}"
"GITHUB_REF=${{ github.ref }}"
"RELEASE=${{ github.sha }}"
"SENTRY_DSN=${{ vars.SENTRY_DSN }}"
"SENTRY_ORG=${{ vars.SENTRY_ORG }}"
"SENTRY_PROJECT=${{ vars.SENTRY_PROJECT }}"
"SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}"
# Deploy the Docker image to the GKE cluster
- name: Deploy
Expand Down
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,16 @@ ARG IS_TESTNET
ENV IS_TESTNET ${IS_TESTNET}
ARG GA_TRACKING_ID
ENV GA_TRACKING_ID ${GA_TRACKING_ID}
ARG RELEASE
ENV RELEASE ${RELEASE}
ARG SENTRY_DSN
ENV SENTRY_DSN ${SENTRY_DSN}
ARG SENTRY_ORG
ENV SENTRY_ORG ${SENTRY_ORG}
ARG SENTRY_PROJECT
ENV SENTRY_PROJECT ${SENTRY_PROJECT}
ARG SENTRY_AUTH_TOKEN
ENV SENTRY_AUTH_TOKEN ${SENTRY_AUTH_TOKEN}
ENV NODE_ENV production
COPY ./ ./
RUN yarn build
Expand Down
4 changes: 2 additions & 2 deletions components/ContentFingerprintLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<script lang="ts">
import { Vue, Component, Prop } from 'vue-property-decorator'
import { IPFS_VIEW_GATEWAY_URL } from '~/constant';
import { ARWEAVE_ENDPOINT, IPFS_VIEW_GATEWAY_URL } from '~/constant';
export enum ContentFirgerprints {
arweave = 'ar',
Expand All @@ -30,7 +30,7 @@ export default class ContentFingerprintLink extends Vue {
if (!this.item) return null
switch (this.prefix) {
case ContentFirgerprints.arweave:
return `https://arweave.net/${this.item.slice(5)}`
return `${ARWEAVE_ENDPOINT}/${this.item.slice(5)}`
case ContentFirgerprints.ipfs:
return `${IPFS_VIEW_GATEWAY_URL}/${this.item.slice(7)}`
Expand Down
6 changes: 5 additions & 1 deletion components/FileUploadedInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
class="mb-[12px]"
>
<a
:href="`https://arweave.net/${arweaveId}`"
:href="`${arweaveEndPoint}/${arweaveId}`"
target="_blank"
rel="noopener noreferrer"
>
Expand All @@ -51,10 +51,14 @@
<script lang="ts">
import { Vue, Component, Prop } from 'vue-property-decorator'
import { ARWEAVE_ENDPOINT } from '~/constant'
@Component
export default class FileUploadedInfo extends Vue {
@Prop(String) readonly ipfsHash!: string
@Prop(String) readonly arweaveId!: string
@Prop(Number) readonly step: number | undefined
arweaveEndPoint = ARWEAVE_ENDPOINT
}
</script>
5 changes: 3 additions & 2 deletions components/NFTMint/WriterMessage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</div>
</div>

<div class="flex justify-center">
<div v-if="!isNewsPress" class="flex justify-center">
<Button
preset="tertiary"
text-preset="h6"
Expand All @@ -57,7 +57,7 @@
</Button>
</div>

<template v-if="shouldShowSettings">
<template v-if="shouldShowSettings && !isNewsPress">
<div
class="flex flex-col justify-start gap-[32px] p-[20px] pb-[24px] border-2 border-[#E6F4F2] rounded-[16px] w-full"
>
Expand Down Expand Up @@ -179,6 +179,7 @@ export default class WriterMessage extends Vue {
@Prop(Number) readonly mintAmount!: number
@Prop(Number) readonly maxMintAmount!: number
@Prop(String) readonly collectExpiryDate!: string
@Prop(Boolean) readonly isNewsPress!: boolean
userInfo: any = undefined
avatar: string = ''
Expand Down
2 changes: 2 additions & 0 deletions constant/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,5 @@ export const SIGN_AUTHORIZATION_PERMISSIONS = [
'read:nftcollection',
'write:nftcollection',
]

export const ARWEAVE_ENDPOINT = IS_TESTNET ? 'https://gateway.irys.xyz' : 'https://arweave.net';
33 changes: 31 additions & 2 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const {
CI,
GA_TRACKING_ID,
SENTRY_DSN,
RELEASE,
} = process.env;

export default {
Expand Down Expand Up @@ -105,6 +106,14 @@ export default {
"'unsafe-inline'",
'fonts.googleapis.com',
],
'worker-src': [
"'self'",
'blob:',
],
'child-src': [
"'self'",
'blob:',
],
},
},
},
Expand Down Expand Up @@ -159,12 +168,32 @@ export default {

sentry: {
config: {
ignoreErrors: ['WebAssembly.instantiate'],
release: RELEASE,
},
tracing: {
// TODO: remove health check http calls from tracing
tracesSampleRate: IS_TESTNET ? 0.01 : 0.01,
browserTracing: {},
vueOptions: {
trackComponents: true,
},
vueRouterInstrumentationOptions: {
routeLabel: 'name',
},
},
publishRelease: !!RELEASE,
clientIntegrations: {
/* default integrations will still be added due to deep-merge */
ReportingObserver: false, // reporting is very noisy on CSP violation.
CaptureConsole: { levels: ['error'] },
Replay: {},
},
clientConfig: {
ignoreErrors: [
'WebAssembly.instantiate',
'["@context"].toLowerCase',
],
replaysSessionSampleRate: IS_TESTNET ? 1.0 : 0.05,
replaysOnErrorSampleRate: IS_TESTNET ? 1.0 : 1.0,
},
},
sitemap: {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@keplr-wallet/types": "^0.11.4",
"@likecoin/iscn-js": "^0.6.10",
"@likecoin/iscn-message-types": "^0.0.7",
"@likecoin/wallet-connector": "^0.26.6",
"@likecoin/wallet-connector": "^0.26.7",
"@nuxtjs/axios": "^5.13.6",
"@nuxtjs/i18n": "^7.0.1",
"@nuxtjs/sentry": "^8.0.7",
Expand Down Expand Up @@ -78,6 +78,7 @@
"@nuxtjs/storybook": "^4.1.1",
"@nuxtjs/stylelint-module": "^4.0.0",
"@nuxtjs/tailwindcss": "^5.3.5",
"@sentry/webpack-plugin": "2",
"@types/lodash.chunk": "^4.2.6",
"@types/lodash.debounce": "^4.0.6",
"@types/mime-types": "^2.1.1",
Expand Down
3 changes: 2 additions & 1 deletion pages/new/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
<script lang="ts">
import { Vue, Component } from 'vue-property-decorator'
import { namespace } from 'vuex-class'
import { ARWEAVE_ENDPOINT } from '~/constant';
import { ISCNRecordWithID } from '~/utils/cosmos/iscn/iscn.type'
import { logTrackerEvent } from '~/utils/logger';
Expand Down Expand Up @@ -171,7 +172,7 @@ export default class NewIndexPage extends Vue {
if ((this.urlIpfsHash || this.urlArweaveId) && this.shouldSkipToMintNFT) {
this.state = 'iscn';
let url;
if (this.urlArweaveId) url = `https://arweave.net/${this.urlArweaveId}`;
if (this.urlArweaveId) url = `${ARWEAVE_ENDPOINT}/${this.urlArweaveId}`;
else if (this.urlIpfsHash) url = `https://ipfs.io/ipfs/${this.urlIpfsHash}`;
if (url) {
const { data, headers } = await this.$axios.get(url, { responseType: 'blob' })
Expand Down
7 changes: 5 additions & 2 deletions pages/nft/iscn/_iscnId.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
:max-mint-amount="maxMintAmount"
:reserve-amount.sync="reserveNft"
:collect-expiry-date.sync="collectExpiryDate"
:is-news-press="isNewsPress"
@message-change="(value) => (message = value)"
@update-mint-amount.once="handleInputMintAmount"
@update-reserve.once="handleInputReserveNft"
Expand Down Expand Up @@ -142,7 +143,7 @@ import {
} from '~/constant/api'
import { getSigningClient } from '~/utils/cosmos/iscn/sign'
import { ISCNRecordWithID } from '~/utils/cosmos/iscn/iscn.type'
import { LIKER_LAND_URL, LIKER_NFT_API_WALLET, LIKER_NFT_FEE_WALLET } from '~/constant'
import { ARWEAVE_ENDPOINT, LIKER_LAND_URL, LIKER_NFT_API_WALLET, LIKER_NFT_FEE_WALLET } from '~/constant'
import sendLIKE from '~/utils/cosmos/sign'
import { getAccountBalance } from '~/utils/cosmos'
import { logTrackerEvent } from '~/utils/logger'
Expand Down Expand Up @@ -226,6 +227,8 @@ export default class NFTMintPage extends Vue {
@walletModule.Getter('getSigner') signer!: OfflineSigner | null
platform = this.$route.query.platform as string || ''
isNewsPress = !!this.$route.query.news_press && this.$route.query.news_press !== '0'
classId: string = ''
nftsIds: string[] = []
Expand Down Expand Up @@ -726,7 +729,7 @@ export default class NFTMintPage extends Vue {
}
if (arweaveID) {
try {
const { data } = await this.$axios.get(`https://arweave.net/${arweaveID}`, { responseType: 'blob' })
const { data } = await this.$axios.get(`${ARWEAVE_ENDPOINT}/${arweaveID}`, { responseType: 'blob' })
this.ogImageBlob = data
this.defaultOgImageBlob = data
this.ogImageArweaveId = arweaveID
Expand Down
3 changes: 2 additions & 1 deletion pages/view/_iscnId/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ import {
WALLET_TYPE_REPLACER,
IPFS_VIEW_GATEWAY_URL,
LIKER_LAND_URL,
ARWEAVE_ENDPOINT,
} from '~/constant'
Expand Down Expand Up @@ -687,7 +688,7 @@ export default class ViewIscnIdPage extends Vue {
get viewContentURL() {
const arURL = this.recordData.contentFingerprints.find(a => a.startsWith('ar://'));
if (arURL) return `https://arweave.net/${arURL.slice(5)}`
if (arURL) return `${ARWEAVE_ENDPOINT}/${arURL.slice(5)}`
const ipfsURL = this.recordData.contentFingerprints.find(a => a.startsWith('ipfs://'));
if (ipfsURL) return `${IPFS_VIEW_GATEWAY_URL}/${ipfsURL.slice(7)}`
const httpsURL = this.recordData.contentFingerprints.find(a => a.startsWith('https://'));
Expand Down
4 changes: 1 addition & 3 deletions store/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ let restoreSessionPromise: any = null

async function getLikeCoinWalletLib() {
if (!likecoinWalletLib) {
likecoinWalletLib = await import(
/* webpackChunkName: "likecoin_wallet" */ '@likecoin/wallet-connector'
)
likecoinWalletLib = await import(/* webpackChunkName: "likecoin_wallet" */ '@likecoin/wallet-connector')
}
return likecoinWalletLib
}
Expand Down
Loading

0 comments on commit e6206c3

Please sign in to comment.