Upload one file per Vercel preview deployment (#32231)

Currently, the Vercel preview workflow uses the default `vercel deploy`
behavior, which uploads every source file to Vercel. The result is often
rate limiting by the Vercel API, which prevents some preview workflows
from running.

This change adds the `--archive=tgz` flag to the `vercel deploy` command
to upload a single tarball instead, as recommended by Vercel support.

The flag is undocumented, but you can consult the PR that added it to
the `vercel` CLI (vercel/vercel#8356) for context.
This commit is contained in:
Paul Gottschling 2023-09-20 16:26:44 -04:00 committed by GitHub
parent 91dd4826b5
commit b529a4b9e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -39,7 +39,7 @@ jobs:
- name: Deploy Project Artifacts to Vercel
id: deploy
run: |
vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} > deployment-url.txt
vercel deploy --archive=tgz --prebuilt --token=${{ secrets.VERCEL_TOKEN }} > deployment-url.txt
preview_url="$(cat deployment-url.txt)"
echo "PREVIEW_URL=$preview_url" >> $GITHUB_OUTPUT
- uses: actions/github-script@v6