Skip to content

825 automate preview deployment #12

825 automate preview deployment

825 automate preview deployment #12

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 }}