Skip to content

Commit f4e356c

Browse files
authored
revert: remove gh-pages branch deploy and PR preview workflow (#18)
Going with Netlify for PR previews instead, which requires zero workflow changes and keeps the production GitHub Pages setup untouched. Reverts deploy-pages.yml to the original GitHub Pages API approach and removes pr-preview.yml. Also reverts the VITE_BASE_URL change in vite.config.ts since it's no longer needed. Co-authored-by: Hermes Alby <hermes-alby@users.noreply.github.com>
1 parent 6d93045 commit f4e356c

3 files changed

Lines changed: 19 additions & 59 deletions

File tree

.github/workflows/deploy-pages.yml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@ on:
66
workflow_dispatch:
77

88
permissions:
9-
contents: write
9+
contents: read
10+
pages: write
11+
id-token: write
1012

1113
concurrency:
1214
group: "pages"
1315
cancel-in-progress: true
1416

1517
jobs:
16-
build-deploy:
18+
build:
1719
runs-on: ubuntu-latest
1820
steps:
1921
- name: Checkout
@@ -31,14 +33,18 @@ jobs:
3133
- name: Build
3234
run: npm run build
3335

34-
- name: Deploy to GitHub Pages
35-
uses: peaceiris/actions-gh-pages@v4
36+
- name: Upload artifact
37+
uses: actions/upload-pages-artifact@v3
3638
with:
37-
github_token: ${{ secrets.GITHUB_TOKEN }}
38-
publish_branch: gh-pages
39-
publish_dir: ./dist
40-
# Preserve PR preview directories so they aren't wiped on main deploy
41-
keep_dirs: pr-preview
42-
user_name: "github-actions[bot]"
43-
user_email: "github-actions[bot]@users.noreply.github.com"
44-
commit_message: "deploy: ${{ github.sha }}"
39+
path: ./dist
40+
41+
deploy:
42+
environment:
43+
name: github-pages
44+
url: ${{ steps.deployment.outputs.page_url }}
45+
runs-on: ubuntu-latest
46+
needs: build
47+
steps:
48+
- name: Deploy to GitHub Pages
49+
id: deployment
50+
uses: actions/deploy-pages@v4

.github/workflows/pr-preview.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import react from "@vitejs/plugin-react";
33
import path from "node:path";
44

55
export default defineConfig({
6-
base: process.env.VITE_BASE_URL || "./",
6+
base: "./",
77
plugins: [react()],
88
resolve: {
99
alias: {

0 commit comments

Comments
 (0)