---
title: "How to deploy your Netlify site with an Elgato Stream Deck"
description: "I often use my Elgato Stream Deck to open URLs in my browser. And this got me thinking — what if I could kick off a site build on Netlify at the press of a button? And as it turns out, we can do this with a little serverless function! Let’s take a look."
source: "https://www.netlify.com/blog/how-to-deploy-your-netlify-site-with-an-elgato-stream-deck/"
last_updated: "2026-07-09T01:21:49.000Z"
---
I’m a big fan of my Elgato Stream Deck. Not only is it incredibly useful whilst I’m live streaming, but I also use it to give me quick access to some of the things I do regularly, such as opening particular URLs in my browser or toggling my office lighting. And this got me thinking — what if I could kick off a site build on Netlify at the press of a button? And as it turns out, we can do this with a little serverless function! Let’s take a look.

## Create a build hook

The first thing we’re going to do is create [a new build hook](https://docs.netlify.com/configure-builds/build-hooks/). Build hooks give you a unique URL you can use to trigger a build with an HTTP POST request.

Head on over to your site settings in Netlify, click on **Build & deploy** and scroll down to **Build hooks**. Click on **Add build hook**, choose a name for your new hook — I chose Function deploy — and click **Save**.

![A screenshot showing adding a new build hook named Function deploy](https://cdn.sanity.io/images/o0o2tn5x/production/402b280df1e8aa0da20ec74e9faaae8cf0b8cb0d-942x422.png?w=450)

Copy your new build hook to your clipboard for the next part.

![A screenshot showing the new build hook has been added](https://cdn.sanity.io/images/o0o2tn5x/production/1c0d8be760a48a0d976e02a463f3f052897c8f66-939x334.png?w=450)

## Add two new environment variables

We want to make sure that we add some protection around this deploy mechanism. We don’t want bots and naughty people deploying your site without your knowledge! We’re going to create two new environment variables — or secrets — that only you and your code have access to.

### DEPLOY\_ME\_URL

First, let’s add the build hook URL secret. You can do this in the Netlify UI by navigating to your site settings > Build & deploy > Environment. Click on **Add variable**, add `DEPLOY_ME_URL` as the key, and your build hook URL as the value. Click **Save**.

![A screenshot showing the deploy me url has been added into the UI, ready to click save](https://cdn.sanity.io/images/o0o2tn5x/production/7a0b670df670afcd1f32f7e8faf7ff0b2f8a3b71-938x438.png?w=450)

You can also do this using the Netlify CLI. In your terminal, use the following command, making sure to switch out `{https://your_build_hook}` for the build hook URL you created above.

```
netlify env:set DEPLOY_ME_URL {https://your_build_hook}
```

### DEPLOY\_ME\_SECRET

To keep our serverless function secure, we’re going to set it up to run **only if a particular query parameter is passed into the function on the URL**. This string can be anything you choose, but to remain non-guessable it should be similar to a secure password. You can use a random string generator, or build one yourself.

Add your deploy secret as an environment variable using the key `DEPLOY_ME_SECRET`. Now we’re ready to write some code!

## Create the serverless function

If you don’t have any Netlify functions in your project already, create a functions directory at the root of your project and name it `functions`. This will automatically be picked up by Netlify when you deploy. Add a new file into this directory, and name it `deployme.js`.

![A screenshot of a file tree in VSCode showing the functions directory with deployme.js inside](https://cdn.sanity.io/images/o0o2tn5x/production/cf9594062411d2a5dad682cf25bf7996d98c8b84-610x144.png?w=450)

### Install node-fetch

Run the following command in your terminal. This will install node-fetch for use in the function.

```
npm install node-fetch
```

Add the following code to `deployme.js`, and let’s unpack what it does.

/functions/deployme.js

```
const fetch = require("node-fetch");
exports.handler = async function (event, context) {  if (event.queryStringParameters.secret === process.env.DEPLOY_ME_SECRET) {    const response = await fetch(process.env.DEPLOY_ME_URL, {      method: "POST",    });
    return {      statusCode: 200,      body: "Your site is now deploying! Have a great day!",    };  } else {    return {      statusCode: 403,      body: "Access denied! Please include the correct secret URL parameter.",    };  }};
```

The first line of the function checks if the secret query parameter on the URL (`?secret=`) matches the value you added as the `DEPLOY_ME_SECRET`. If the secret doesn’t match, the function returns an HTTP 403 (forbidden), and the site doesn’t deploy.

If the secret value matches the environment variable, the function makes a post request to your `DEPLOY_ME_URL`, tells you to have a nice day, and kicks off a site build in Netlify!

Next, commit and push your code to your repo. Once the code has deployed to Netlify, it’s time to hook up the Stream Deck!

## Set up the Stream Deck button

Head on over to your Stream Deck profile, and drag a new **Website** button to your deck. Name the button whatever you like, and add the following URL, making sure to add your own site domain and `DEPLOY_ME_SECRET`. You can choose to check “GET request in background” but I prefer to open a browser window for that sweet, sweet feedback.

```
https://{yoursitedomain}/.netlify/functions/deployme.js?secret={DEPLOY_ME_SECRET}
```

![A screenshot of a new Stream Deck profile with a new website button added, with the label DEPLOY](https://cdn.sanity.io/images/o0o2tn5x/production/608111aec62f9cad158baa4f377ce8aa25fca81d-952x840.png?w=450)

And you’re done! Whenever you click that button, a new site deploy on Netlify will begin! If you’d like to read more about serverless functions on Netlify, be sure to [check out the docs](https://docs.netlify.com/functions/overview/), and [let me know on Twitter](https://twitter.com/whitep4nth3r) if you’ve found any other fancy uses for a Stream Deck!

### Share

-   [X (fka Twitter)](https://twitter.com/intent/tweet?text=How to deploy your Netlify site with an Elgato Stream Deck&url=https://www.netlify.com/blog/how-to-deploy-your-netlify-site-with-an-elgato-stream-deck/)
-   [LinkedIn](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fwww.netlify.com%2Fblog%2Fhow-to-deploy-your-netlify-site-with-an-elgato-stream-deck%2F)
-   [Facebook](https://www.facebook.com/sharer.php?u=https://www.netlify.com/blog/how-to-deploy-your-netlify-site-with-an-elgato-stream-deck/)
-   [Bluesky](https://bsky.app/intent/compose?text=How to deploy your Netlify site with an Elgato Stream Deck+https://www.netlify.com/blog/how-to-deploy-your-netlify-site-with-an-elgato-stream-deck/)

* * *

### Tags

-   [Netlify Functions](/blog/tags/netlify-functions/)

## Keep reading

![](/images/blog-fallback-thumbnail.svg)

Guides & Tutorials December 12, 2021

[

### How to test serverless functions locally

](/blog/2021/12/12/how-to-test-serverless-functions-locally)

-   ![Profile picture of Phil Hawksworth](/_astro/9cfe2bbe94bcb555ce3ac7683ac7905ad3fd32b1-400x400_Z18H6R1.webp)
    
    Phil Hawksworth
    

![](/images/blog-fallback-thumbnail.svg)

Guides & Tutorials January 18, 2022

[

### How to use really long environment variables in Netlify functions

](/blog/how-to-use-really-long-environment-variables-in-netlify-functions)

-   ![Profile picture of Salma Alam-Naylor](/_astro/824da0593d02b9571a577aed4ff1d70073e3c797-1000x1000_Z2qMuVc.webp)
    
    Salma Alam-Naylor
    

## Recent posts

News & Announcements June 25, 2026

[

### Netlify Functions, designed for Agent Experience

](/blog/netlify-functions-designed-for-agent-experience)

-   ![Profile picture of Eduardo Bouças](/_astro/52958f21e8450baf6d8e60302341a984e220c0cd-512x512_13VDlu.webp)
    
    Eduardo Bouças
    

News & Announcements June 24, 2026

[

### How we measure Netlify’s Agent Experience

](/blog/how-we-measure-netlify-agent-experience)

-   ![Profile picture of Sean Roberts](/_astro/bbf2243f8171dbddd80ab2103622106cef84d125-512x512_Z1d2LKE.webp)
    
    Sean Roberts
    

Guides & Tutorials May 15, 2026

[

### How to build a real-time AI chatbot in minutes with Netlify Agent Runners (no backend)

](/blog/how-to-build-a-real-time-ai-chatbot-in-minutes-with-netlify-agent-runners-no-backend)

-   ![Profile picture of Nahrin Jalal](/_astro/f0e7c8f227a03fe58340c99ef5439d5a896c0733-272x272_Z23kDpD.webp)
    
    Nahrin Jalal
    

![](/_astro/3f255b372fa958df35802666ee33b4609b2d71bd-1200x1586_1VtE2D.webp)

### How do the best dev and marketing teams work together?

[Access the report](https://www.netlify.com/reports/2024-leadership-trend-report/access/)