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

Deploy to Production #37

Merged
merged 6 commits into from
Jul 9, 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
31 changes: 31 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,34 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: dist

deploy-to-arweave:
runs-on: ubuntu-latest
needs: build
environment: staging
if: ${{ github.ref == 'refs/heads/develop' }}
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'yarn'

- name: Install, Build, and Deploy 🔧
run: |
yarn install --frozen-lockfile
yarn deploy
env:
# FOR BUILD
VITE_NODE_ENV: develop
VITE_SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
VITE_SENTRY_RELEASE: ${{ github.sha }}
VITE_SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
VITE_SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
VITE_SENTRY_DSN_PUBLIC_KEY: ${{ secrets.SENTRY_DSN_PUBLIC_KEY }}
VITE_SENTRY_DSN_PROJECT_URI: ${{ secrets.SENTRY_DSN_PROJECT_URI }}
VITE_SENTRY_DSN_PROJECT_ID: ${{ secrets.SENTRY_DSN_PROJECT_ID }}
VITE_GITHUB_HASH: ${{ github.sha }}
DEPLOY_ANT_PROCESS_ID: ${{ secrets.DEPLOY_ANT_PROCESS_ID }}
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
32 changes: 32 additions & 0 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,35 @@ jobs:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_CI_SERVICE_ACCOUNT }}'
channelId: live

deploy-to-arweave:
runs-on: ubuntu-latest
needs: build
environment: production
if: ${{ github.ref == 'refs/heads/develop' }}
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'yarn'

- name: Install, Build, and Deploy 🔧
run: |
yarn install --frozen-lockfile
yarn deploy
env:
# FOR BUILD
VITE_NODE_ENV: production
VITE_SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
VITE_SENTRY_RELEASE: ${{ github.sha }}
VITE_SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
VITE_SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
VITE_SENTRY_DSN_PUBLIC_KEY: ${{ secrets.SENTRY_DSN_PUBLIC_KEY }}
VITE_SENTRY_DSN_PROJECT_URI: ${{ secrets.SENTRY_DSN_PROJECT_URI }}
VITE_SENTRY_DSN_PROJECT_ID: ${{ secrets.SENTRY_DSN_PROJECT_ID }}
VITE_GITHUB_HASH: ${{ github.sha }}
VITE_IO_PROCESS_ID: ${{ secrets.IO_PROCESS_ID }}
DEPLOY_ANT_PROCESS_ID: ${{ secrets.DEPLOY_ANT_PROCESS_ID }}
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
.DS_Store
coverage
dist
node_modules
cache
*.log
.idea
.idea
dist-id.txt
dist-manifest.csv
dist-manifest.json
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
# network-portal
Application for interacting with the ar.io network.

## Deployment

Running `yarn deploy` uses the following environment variables:

```
export VITE_IO_PROCESS_ID=[process ID for IO process]
export DEPLOY_ANT_PROCESS_ID=[process id of the ant process to deploy to]
export DEPLOY_KEY=[base64 encoded version of wallet keyfile]
```

For local testing, you can create a deploy.sh script with the above valeus defined, run `source deploy.sh`, then use `yarn deploy`.
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"build": "yarn clean && tsc --build tsconfig.build.json && NODE_OPTIONS=--max-old-space-size=32768 vite build",
"clean": "rimraf dist",
"clean": "rimraf dist && rm -f dist-*",
"dev": "NODE_ENV=prod VITE_GITHUB_HASH=local vite",
"format": "prettier --write .",
"lint:fix": "eslint --fix .",
Expand All @@ -16,7 +16,8 @@
"test:coverage": "NODE_ENV=test jest --coverage",
"prepare": "husky || true",
"pre-commit": "lint-staged",
"vis": "yarn vite-bundle-visualizer"
"vis": "yarn vite-bundle-visualizer",
"deploy": "yarn build && permaweb-deploy --ant-process ${DEPLOY_ANT_PROCESS_ID}"
},
"dependencies": {
"@ar.io/sdk": "1.2.0-alpha.15",
Expand Down Expand Up @@ -83,13 +84,14 @@
"lint-staged": "^15.2.2",
"lodash": "^4.17.21",
"nyc": "^15.1.0",
"permaweb-deploy": "^1.1.5",
"postcss": "^8.4.35",
"prettier": "^3.2.5",
"prettier-plugin-organize-imports": "^3.2.4",
"prettier-plugin-tailwindcss": "^0.5.14",
"rimraf": "^5.0.5",
"tailwindcss": "^3.4.1",
"tailwind-scrollbar": "^3.1.0",
"tailwindcss": "^3.4.1",
"tailwindcss-animate": "^1.0.7",
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Observers/ObserversTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ const ObserversTable = () => {
(acc, observer) => {
const gateway = gateways[observer.gatewayAddress];

const submitted = observations.reports[observer.gatewayAddress];
const submitted = observations.reports[observer.observerAddress];
const status = submitted ? 'Submitted' : 'Pending';
const numFailedGatewaysFound = submitted
? Object.values(observations.failureSummaries).reduce(
(acc, summary) => {
return (
acc + (summary.includes(observer.gatewayAddress) ? 1 : 0)
acc + (summary.includes(observer.observerAddress) ? 1 : 0)
);
},
0,
Expand Down
Loading
Loading