diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml new file mode 100644 index 0000000..d129f66 --- /dev/null +++ b/.github/workflows/preview.yml @@ -0,0 +1,25 @@ +name: Preview Environment + +env: + VERCEL_ACCESS_TOKEN: ${{ secrets.VERCEL_ACCESS_TOKEN }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} + +on: + pull_request: + types: [opened, synchronize, closed] + branches: + - main + +jobs: + deploy: + if: ${{ github.event.action == 'opened' || github.event.action == 'synchronize' }} + runs-on: ubuntu-latest + steps: + - uses: snaplet/vercel-action@v3.0.1 + delete: + if: ${{ github.event.action == 'closed' }} + runs-on: ubuntu-latest + steps: + - uses: snaplet/vercel-action@v3.0.1 + with: + delete: true