Skip to content
Closed

fix #65

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions .github/workflows/build-and-preview-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,10 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}

- name: Install and Build 🔧
env:
PATH_PREFIX: /recognition/preview-badges/pr-${{ github.event.pull_request.number }}
run: |
npm install
node -v
npm run build -- --prefix-paths
npm run build

- name: Remove CNAME file
run: |
Expand Down Expand Up @@ -61,14 +59,12 @@ jobs:
uses: actions/checkout@v6

- name: Download pre-built site
if: github.event_name == 'pull_request_target'
uses: actions/download-artifact@v4
with:
name: public-dir
path: .

- name: Extract site
if: github.event_name == 'pull_request_target'
run: |
unzip -q public-dir.zip
# Ensure the extracted folder has the static files in a 'public' dir for the action
Expand All @@ -77,17 +73,19 @@ jobs:
elif [ ! -d "public" ]; then
echo "Warning: Neither public nor public-dir found after extraction"
fi
# Ensure CNAME is removed from the preview
rm -f public/CNAME

- name: Deploy Preview
if: github.event_name == 'pull_request_target' && github.event.action != 'closed'
if: github.event.action != 'closed'
uses: rossjrw/[email protected]
with:
source-dir: public
umbrella-dir: preview-badges
token: ${{ secrets.GITHUB_TOKEN }}

- name: Remove Preview on Close
if: github.event_name == 'pull_request_target' && github.event.action == 'closed'
if: github.event.action == 'closed'
uses: rossjrw/[email protected]
with:
source-dir: public
Expand Down
Loading