From df00abf4de418723242e969e6e219c5d91caf5c7 Mon Sep 17 00:00:00 2001 From: Casper Date: Sun, 13 Sep 2026 02:08:40 +0200 Subject: [PATCH] ci: deploy Pages through GitHub Actions --- .github/workflows/deploy.yml | 46 ++++++++++++++++-------------------- .pages-release | 5 ++-- package.json | 2 +- public/site/index.html | 18 ++++++++++++++ 4 files changed, 43 insertions(+), 28 deletions(-) create mode 100644 public/site/index.html diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2b5bf942..000acb30 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,4 +1,4 @@ -name: Publish GitHub Pages site +name: Deploy GitHub Pages site on: push: @@ -6,15 +6,21 @@ on: workflow_dispatch: permissions: - contents: write + contents: read + pages: write + id-token: write concurrency: - group: github-pages-source + group: github-pages cancel-in-progress: true jobs: - publish: - name: Verify and publish static site + deploy: + if: github.ref == 'refs/heads/main' + name: Verify and deploy static site + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest steps: @@ -27,30 +33,20 @@ jobs: node-version: 22 cache: npm + - name: Configure Pages + uses: actions/configure-pages@v6 + - name: Install dependencies run: npm ci --include=optional - name: Verify application run: npm run verify - - name: Build GitHub Pages site - run: npm run build:pages - - - name: Upload generated site artifact - uses: actions/upload-artifact@v6 + - name: Upload GitHub Pages artifact + uses: actions/upload-pages-artifact@v5 with: - name: math-biotech-pages-site - path: site - if-no-files-found: error - - - name: Commit generated site to main - run: | - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git add -A site - if git diff --cached --quiet; then - echo "Generated site is already current." - else - git commit -m "chore: publish GitHub Pages site [skip ci]" - git push origin HEAD:main - fi + path: dist + + - name: Deploy GitHub Pages + id: deployment + uses: actions/deploy-pages@v5 diff --git a/.pages-release b/.pages-release index 0f838628..02cadd5c 100644 --- a/.pages-release +++ b/.pages-release @@ -1,3 +1,4 @@ Math Biotech GitHub Pages release -Deployed: 2026-08-06T00:18:30+02:00 -Site path: /Math-Biotech-Project/site/ +Deployment: GitHub Actions +Site path: /Math-Biotech-Project/ +Legacy redirect: /Math-Biotech-Project/site/ diff --git a/package.json b/package.json index db92af06..3433dcb3 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "dev": "vite", "build": "vite build", - "build:pages": "vite build --base=/Math-Biotech-Project/site/ --outDir site --emptyOutDir", + "build:pages": "vite build", "preview": "vite preview", "typecheck": "tsc --noEmit", "test": "vitest run", diff --git a/public/site/index.html b/public/site/index.html new file mode 100644 index 00000000..9f333281 --- /dev/null +++ b/public/site/index.html @@ -0,0 +1,18 @@ + + + + + + + Redirecting… + + + +

Continue to Math Biotech

+ +