-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2293 from johnny-morrice/feature/netlify-manual-d…
…eploy Netlify manual deploy
- Loading branch information
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |