From a9106c1d032d63b0b7139e0627db463dd54cf792 Mon Sep 17 00:00:00 2001 From: Hamlet Jiang Su <30667958+hjiangsu@users.noreply.github.com> Date: Mon, 8 Apr 2024 10:46:29 -0700 Subject: [PATCH] added github workflow --- .github/workflows/deploy.yml | 32 ++++++++++++++++++++++++++++++++ package.json | 4 ++-- 2 files changed, 34 insertions(+), 2 deletions(-) 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..a5b05c4 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,32 @@ +name: Deploy to GitHub Pages + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Install dependencies + run: npm install + + - name: Build site + run: npm run build + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./dist + publish_branch: gh-pages diff --git a/package.json b/package.json index 367e1bc..82e3c8b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "thunder_site", - "homepage": "http://thunder-app.github.io", + "homepage": "https://thunder-app.github.io", "private": true, "version": "0.0.0", "type": "module", @@ -8,7 +8,7 @@ "dev": "vite", "build": "tsc && vite build", "predeploy" : "npm run build", - "deploy" : "gh-pages -d build", + "deploy" : "gh-pages -d dist --cname thunderapp.dev", "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "preview": "vite preview" },