well-known-fursona/.build.yml
2023-05-05 11:22:22 +01:00

34 lines
938 B
YAML

image: alpine/edge
secrets:
- a2e02b24-b89f-4d60-8319-c6883b567430
- 50b9ba48-c450-43df-a46d-01e2cf0ef9c1
packages:
- nodejs
- npm
sources:
- git@git.sr.ht:~gmem/well-known-fursona
tasks:
- vercel-deploy: |
set +x
export VERCEL_API_TOKEN=$(cat ~/.vercel)
echo "Creating Vercel project"
cd well-known-fursona
mkdir -p .vercel
mv ~/.vercel-well-known-fursona .vercel/project.json
echo "Installing Vercel CLI"
# Install vercel cli
sudo npm i -g vercel
# Get current git branch
echo "Deploying to Vercel"
export CI_BRANCH=$(git rev-parse --abbrev-ref HEAD)
# If trunk branch, use --prod, otherwise just deploy
if [ "$CI_BRANCH" = "trunk" ]; then
echo "Deploying to production"
vercel deploy --prod --token $VERCEL_API_TOKEN
else
echo "Deploying to preview"
vercel deploy --token $VERCEL_API_TOKEN
fi