-
Notifications
You must be signed in to change notification settings - Fork 251
84 lines (79 loc) · 2.55 KB
/
deploy-to-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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Deploy build to Netlify
on:
workflow_dispatch:
workflow_call:
inputs:
pages-cache-key:
description: key for pages cache
required: true
type: string
pdf-cache-key:
description: key for pdf cache
required: false
type: string
enable-pull-request-comment:
description: whether to comment on the triggering PR
required: false
default: true
type: boolean
enable-commit-comment:
description: whether to comment on the triggering commit
required: false
default: true
type: boolean
alias:
description: name for the deployment (used to set custom / stable Netlify url)
required: false
type: string
production:
description: whether to mark this deployment as the current production deploy for the site
required: false
default: false
type: boolean
secrets:
NETLIFY_SITE_ID:
description: Netlify site ID to deploy to
required: true
NETLIFY_AUTH_TOKEN:
required: true
jobs:
deploy:
runs-on: docs-16c-64gb-600gb
steps:
- name: Pull pages cache
uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
path: |
public/*
!public/pdfs
.cache
key: ${{ inputs.pages-cache-key }}
- name: Pull PDF cache
if: ${{ inputs.pdf-cache-key }}
uses: actions/cache/restore@v4
with:
path: |
product_docs/**/*.pdf
product_docs/**/*.pdf-hash
advocacy_docs/**/*.pdf
advocacy_docs/**/*.pdf-hash
key: ${{ inputs.pdf-cache-key }}
- name: Copy pdfs to build output
run: |
mkdir -p public/pdfs
rsync -avm --filter="+ */" --filter="-! *.pdf" advocacy_docs/ public/pdfs/ || :
rsync -avm --filter="+ */" --filter="-! *.pdf" product_docs/docs/ public/pdfs/ || :
- name: Deploy to Netlify
id: netlify-deploy
uses: nwtgck/actions-netlify@v3
with:
publish-dir: "./public"
github-token: ${{ secrets.GITHUB_TOKEN }}
enable-pull-request-comment: ${{ inputs.enable-pull-request-comment }}
enable-commit-comment: ${{ inputs.enable-commit-comment }}
alias: ${{ inputs.alias }}
production-deploy: ${{ inputs.production }}
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}