825 automate preview deployment #12
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |