b.splendous.net

a netlify deploy workflow

December 2025 / tech

My repo became too large for BitBucket. I thought I might run into the same issue eventually with GitHub so I moved to a local gitea insteance.

The actual move was quite easy, the only thing that was difficult was getting a deploy workflow running. There were a few guides online but they seemed more complex than what I needed.

So here's a pretty simple version. You'll need to make sure that gitea actions are set up, but there are good guides available elsewhere. Rather than just using docker in unraid, I found docker compose helpful (I use the docker compose manager plugin).

Then you'll add a workflow file like the below into your repo. This goes into .gitea/workflows/netlify.yaml. You'll need to set NETLIFY_AUTH_TOKEN and NETLIFY_SITE_ID as secrets in gitea; both of these are available in Netlify.

name: Netlify Deploy
run-name: deploy of $\{\{ gitea.ref_name \}\} by $\{\{ gitea.actor \}\}
on: [push]

jobs:
  Netlify-Deploy:
    runs-on: ubuntu-latest
    steps:
      - run: sudo apt-get update
      - run: sudo apt-get install -y ffmpeg

      - name: Check out repository code
        uses: actions/checkout@v4

      - name: Echo Staging
        if: gitea.ref_name != 'master'
        run: echo "staging based on branch name"

      - name: Echo Prod
        if: gitea.ref_name == 'master'
        run: echo "prod based on branch name"

      - name: Setup NodeJS
        uses: actions/setup-node@v4
        with:
          node-version: 24
          cache: "npm"

      - name: Install Dependencies
        run: npm ci

      - name: Build
        run: npm run build

      - name: Deploy Staging
        if: gitea.ref_name != 'master'
        uses: netlify/actions/cli@master
        with:
          args: deploy --no-build --dir=dist
        env:
          NETLIFY_AUTH_TOKEN: $\{\{ secrets.NETLIFY_AUTH_TOKEN \}\}
          NETLIFY_SITE_ID: $\{\{ secrets.NETLIFY_SITE_ID \}\}

      - name: Deploy Prod
        if: gitea.ref_name == 'master'
        uses: netlify/actions/cli@master
        with:
          args: deploy --no-build --prod --dir=dist
        env:
          NETLIFY_AUTH_TOKEN: $\{\{ secrets.NETLIFY_AUTH_TOKEN \}\}
          NETLIFY_SITE_ID: $\{\{ secrets.NETLIFY_SITE_ID \}\}

      - run: echo "🍏 This job's status is $\{\{ job.status \}\}."