Skip to content
Open
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
18 changes: 16 additions & 2 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,29 @@ jobs:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install Dependencies
run: cd client && npm install
- name: Build
env:
NODE_OPTIONS: "--max_old_space_size=4096"
CI: true
run: cd client && npm run build
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: './client/dist/'
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
9 changes: 2 additions & 7 deletions .github/workflows/development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,7 @@ jobs:
env:
NODE_OPTIONS: "--max_old_space_size=4096"
run: cd client && npm run build
- name: Upload Build artifacts
uses: actions/upload-artifact@v3.1.2
with:
name: Build artifacts
path: ./client/dist/


test:
needs: [build-and-install-deps]
runs-on: ubuntu-latest
Expand All @@ -134,5 +129,5 @@ jobs:
with:
path: ./client/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
- name: Build
- name: Test With Coverage
run: cd client && npm run test:cov
27 changes: 25 additions & 2 deletions client/scripts/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ import Bundlr from 'bundlr-custom';
import fs from 'fs';

const main = async () => {

if (!fs.existsSync('./wallet.json')) {
console.log('No wallet file found, please add a wallet.json file to the root of the project');
return;
}
const wallet = './wallet.json';

const jwk = JSON.parse(fs.readFileSync(wallet).toString());
Expand All @@ -25,10 +30,28 @@ const main = async () => {
// Print your wallet address
console.log(`wallet address = ${bundlr.address}`);
const dist = './dist/';

try {
if (fs.existsSync('dist-id.txt')) {
fs.rmSync('dist-id.txt');
}
if (fs.existsSync('dist-manifest.csv')) {
fs.rmSync('dist-manifest.csv');
}
if (fs.existsSync('dist-manifest.json')) {
fs.rmSync('dist-manifest.json');
}
} catch (error) {
// files not found skip
console.log('No previous deploy files found, skipping');
}
console.log('uploading');

const response = await bundlr.uploadFolder(dist, {
indexFile: 'index.html', // optional index file (file the user will load when accessing the manifest)
batchSize: 50, // number of items to upload at once
keepDeleted: false // whether to keep now deleted items from previous uploads
batchSize: 50, // number of items to upload at once,
keepDeleted: false, // keep deleted files in the manifest
logFunction: async (log: string) => console.log(log), // optional function to handle logs
}); // returns the manifest ID

console.log(`SPA Uploaded https://arweave.net/${response?.id}`);
Expand Down