Skip to content

Commit f25785f

Browse files
authored
ci: auto delete preview docs
1 parent 48c2f8f commit f25785f

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Delete preview docs
2+
3+
on:
4+
workflow_dispatch:
5+
delete:
6+
7+
env:
8+
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
9+
10+
jobs:
11+
delete:
12+
name: Delete Vercel Project
13+
if: github.event.ref_type == 'branch'
14+
runs-on: ubuntu-latest
15+
steps:
16+
- run: |
17+
# Set up Vercel
18+
npm install --global vercel@latest
19+
# Pull Vercel environment
20+
vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
21+
# Delete vercel project linked to this branch
22+
vercel remove edsnlp-$BRANCH_NAME --yes --token=${{ secrets.VERCEL_TOKEN }}

0 commit comments

Comments
 (0)