Files
website/.gitea/workflows/deploy.yaml
Gokul 687563b5c5
Some checks failed
Smart Deploy / build-deploy (push) Failing after 42s
modified deploy file
2026-02-08 18:31:41 +05:30

35 lines
1.1 KiB
YAML

name: Smart Deploy
run-name: Deploying ${{ gitea.ref_name }} 🚀
on: [push]
jobs:
build-deploy:
runs-on: ubuntu-latest
# 👇 ADD THIS LINE! It gives the runner a brain (Node.js + Git)
container: node:20-bookworm
steps:
- name: Check out repository code
uses: actions/checkout@v3
# You can keep this, but the container already has Node 20!
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install Dependencies
run: npm ci
- name: Build Astro Site
run: npm run build
- name: Deploy to Production
if: gitea.ref == 'refs/heads/main'
run: npx netlify-cli deploy --prod --dir=dist --site=${{ secrets.NETLIFY_SITE_ID }} --auth=${{ secrets.NETLIFY_AUTH_TOKEN }} --message "Prod ${{ gitea.sha }}"
- name: Deploy Preview
if: gitea.ref != 'refs/heads/main'
run: |
ALIAS=$(echo "${{ gitea.ref_name }}" | tr / -)
npx netlify-cli deploy --dir=dist --alias "$ALIAS" --site=${{ secrets.NETLIFY_SITE_ID }} --auth=${{ secrets.NETLIFY_AUTH_TOKEN }} --message "Preview $ALIAS"