Set up automatic production deploys to Netlify
did:plc:zviscnpwyvj6y32agi5davn5 opened this Sep 10, 2025 0 comments
did:plc:zviscnpwyvj6y32agi5davn5 opened Sep 10, 2025
The way this is set up on GitHub right now is via Netlify's native integration, so we'll need to roll our own. Here's a sample pipeline that ChatGPT conjured:
# .tangled/workflows/deploy.yml
when:
- event: ["push"]
branch: ["main"]
# Spindle will build a container with these tools available
dependencies:
nixpkgs:
- nodejs
- git
steps:
- name: Install
command: |
npm ci
- name: Build (Astro)
command: |
npm run build
- name: Deploy to Netlify (prod)
# Set NETLIFY_AUTH_TOKEN and NETLIFY_SITE_ID in Tangled → Repo → Settings → Secrets
command: |
npx netlify-cli deploy \
--prod \
--dir="dist" \
--site="$NETLIFY_SITE_ID" \
--auth="$NETLIFY_AUTH_TOKEN"No activity yet.