Skip to content

Commit

Permalink
Merge pull request #2293 from johnny-morrice/feature/netlify-manual-d…
Browse files Browse the repository at this point in the history
…eploy

Netlify manual deploy
  • Loading branch information
g-leech authored Feb 9, 2025
2 parents e54bd5e + ea65490 commit 149cac9
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/deploy-netlify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Manual Build & Deploy to Netlify (Dev)

on:
# 1. Manual trigger via the Actions tab
workflow_dispatch:
inputs:
branch:
description: "Branch to build and deploy"
required: false
default: "master"

jobs:
build-and-deploy:
name: Build and Deploy to Netlify
runs-on: ubuntu-latest

# 2. Use the environment named 'Dev'
# so that environment-scoped secrets are available
environment: Dev

steps:
# 3. Check out the specified branch
- name: Check out code
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.branch }}

# 4. Build the site using your existing Docker build script
- name: Build the site using Docker
run: |
./scripts/build.sh
# 5. Deploy to Netlify using the Netlify CLI Action
- name: Deploy to Netlify
uses: netlify/actions/cli@master
with:
# --prod does a production deploy
args: deploy --dir=_site --prod
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}

0 comments on commit 149cac9

Please sign in to comment.