image: alpine/edge secrets: - ea81f650-6b7e-4cbb-862b-b39195858bfd - 50b9ba48-c450-43df-a46d-01e2cf0ef9c1 - 921891a4-e0a9-4753-9275-b010d2e2520a packages: - nodejs - npm sources: - git@git.sr.ht:~gmem/well-known-fursona environment: GITHUB_REPO: "gmemstr/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" git fetch origin trunk # If trunk branch, use --prod, otherwise just deploy if [ "$(git rev-parse origin/trunk)" = "$(git rev-parse HEAD)" ]; then echo "Deploying to production" vercel deploy --prod --token $VERCEL_API_TOKEN else echo "Deploying to preview" vercel deploy --token $VERCEL_API_TOKEN fi - mirror-to-github: | cd well-known-fursona git remote add github git@github.com:$GITHUB_REPO.git ssh-keyscan github.com >> ~/.ssh/known_hosts git push --mirror github