-
Notifications
You must be signed in to change notification settings - Fork 4
45 lines (39 loc) · 1.29 KB
/
deploy-netlify.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Build & Deploy to Netlify
on:
# 1. Manual trigger via the Actions tab
workflow_dispatch:
inputs:
branch:
description: "Branch to build and deploy"
required: false
default: "master"
environment:
description: "Environment to deploy to"
required: false
default: "development"
jobs:
build-and-deploy:
name: Build and Deploy to Netlify
runs-on: ubuntu-latest
# 2. Use the environment input to set the environment
# so that environment-scoped secrets are available
environment: ${{ github.event.inputs.environment }}
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 }}