-
-
Notifications
You must be signed in to change notification settings - Fork 2
63 lines (54 loc) · 1.66 KB
/
main.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
name: Production Deploy
on:
push:
branches:
- master
schedule:
- cron: "0 0 */3 * *"
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
env:
DRIBBBLE_ACCESS_TOKEN: ${{ secrets.DRIBBBLE_ACCESS_TOKEN }}
outputs:
node_version: ${{ steps.node_version.outputs.node_version }}
steps:
- name: Set up Repository
uses: actions/checkout@v2
with:
ref: master
fetch-depth: 0
- name: Get Node Version
id: node_version
run: |
node_version=`cat .nvmrc`
echo "::set-output name=node_version::$node_version"
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: ${{ steps.node_version.outputs.node_version }}
- name: Cache NPM Dependencies
id: cache-npm-dependencies
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}
- name: Install NPM Dependencies if not cached
if: steps.cache-npm-dependencies.outputs.cache-hit != 'true'
run: |
npm install
- name: Generate Metadata files
run: |
last_updated_at=`date +%Y-%m-%dT%H:%M:%S.000%z`
printf "$last_updated_at" > .last-updated-at
- name: Build Website
run: |
NODE_ENV=production npm run generate
- name: Deploy to Netlify
uses: netlify/actions/cli@master
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
with:
args: deploy --dir=dist --prod