-
Notifications
You must be signed in to change notification settings - Fork 8
40 lines (37 loc) · 1.06 KB
/
preview-app-label.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Vercel preview apps on label
env:
VERCEL_ACCESS_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_PROJECT_ID: ${{ secrets.PROJECT_ID }}
on:
pull_request:
types: [labeled]
jobs:
deploy:
if: ${{ github.event.label.name == 'create preview app' }}
runs-on: ubuntu-latest
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
steps:
- uses: actions/checkout@v3
- uses: snaplet/vercel-action@v3
- name: Remove label
uses: fastruby/pr-unlabeler@v1
with:
label-to-remove: "create-preview-app"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
delete:
if: ${{ github.event.label.name == 'destroy preview app' }}
runs-on: ubuntu-latest
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
steps:
- uses: actions/checkout@v3
- uses: snaplet/vercel-action@v3
with:
delete: true
- uses: fastruby/pr-unlabeler@v1
with:
label-to-remove: "create preview app"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}