From e2ba2b83a3ea92b731371513ab854c2f88371960 Mon Sep 17 00:00:00 2001 From: Sahaj Date: Sat, 11 May 2024 02:49:34 +0530 Subject: [PATCH] chore: Deploy workflow --- .github/workflows/deploy.yml | 43 ++++++++++++++++++++++++++++++++++++ package.json | 3 ++- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..a4019bf --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,43 @@ +name: Deploy to GitHub Pages + +on: + push: + branches: [main] + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install deps + run: npm install + + - name: Build website + run: npm run build + + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: github-pages + path: ./dist + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/package.json b/package.json index 3939fb2..22e256d 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "license": "MIT", "scripts": { "dev": "webpack-cli serve --mode=development --env development --hot", - "build": "webpack --mode=production --env production --progress", + "build": "npm run build:wasm; webpack --mode=production --env production --progress", "build:wasm": "cd altr-wasm && wasm-pack build --target web --out-dir pkg", "lint": "eslint './src/**/*.{ts,tsx,js,jsx}'", "lint:fix": "eslint './src/**/*.{ts,tsx,js,jsx}' --fix" @@ -42,6 +42,7 @@ "ts-node": "10.9.1", "tsconfig-paths-webpack-plugin": "^4.1.0", "typescript": "4.9.5", + "wasm-pack": "^0.12.1", "webpack": "5.89.0", "webpack-cli": "4.10.0", "webpack-dev-server": "4.15.1"