From 3a1b66f4cbcd2fe35e88aff8b7d3f7d6c5eea3fc Mon Sep 17 00:00:00 2001 From: Hare Sudhan Date: Wed, 4 Sep 2024 11:37:06 -0400 Subject: [PATCH] modify deploy.yml; not yet tested --- .github/workflows/deploy.yml | 38 ++++++++++++++++++++++++------------ website/package.json | 2 ++ 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8d17c9d6..e3044483 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,16 +1,21 @@ name: Deploy site -env: - VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} - VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} - on: push: branches: - main +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + jobs: - deploy-site: + build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -26,11 +31,20 @@ jobs: run: poetry install - name: Generate MDX run: poetry run python bin/site.py -v - - name: Install Vercel CLI - run: npm install --global vercel@latest - - name: Deploy Project Artifacts to Vercel + + - name: Use Node.js 22.x + uses: actions/setup-node@v3 + with: + node-version: 22.x + - name: Export site + run: | + npm install + npm run export + working-directory: website + - name: Deploy run: | - cd website - vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} - vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} - vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} + git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git + npm run deploy -- -u "github-actions-bot " + working-directory: website + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/website/package.json b/website/package.json index 27c11423..d9ed144f 100644 --- a/website/package.json +++ b/website/package.json @@ -7,6 +7,8 @@ "dev": "next dev", "build": "next build", "start": "next start", + "export": "next build && next export", + "deploy": "gh-pages -d out -t true", "format": "biome format --write .", "check": "biome check --write --unsafe ." },