Repository navigation
68 lines (65 loc) · 1.97 KB
/
Copy pathbuild.yml
File metadata and controls
68 lines (65 loc) · 1.97 KB
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
name: build
on:
push:
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 16
uses: actions/setup-node@v1
with:
node-version: 16
- run: npm ci
- run: npm run build --if-present
# - run: npm test
- uses: actions/upload-artifact@v2
with:
name: build
path: build/
retention-days: 1
deploy-github:
runs-on: ubuntu-latest
needs: build
if: ${{ github.ref == 'refs/heads/master' && github.event_name == 'push' }}
steps:
- uses: actions/download-artifact@v2
with:
name: build
path: build
- name: Copy to domain-graph/domain-graph.github.io
uses: cpina/github-action-push-to-another-repository@v1.2
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source-directory: 'build/dist/'
user-email: stephen.konves@gmail.com
destination-github-username: 'skonves'
destination-repository-username: 'domain-graph'
destination-repository-name: 'domain-graph.github.io'
deploy-netlify:
runs-on: ubuntu-latest
needs: build
if: ${{ github.ref == 'refs/heads/master' && github.event_name == 'push' }}
steps:
- uses: actions/download-artifact@v2
with:
name: build
path: build/
- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v1.2
with:
publish-dir: './build/dist'
functions-dir: './build/functions'
production-branch: netlify
deploy-message: 'Deploy from GitHub Actions'
enable-pull-request-comment: false
enable-commit-comment: false
overwrites-pull-request-comment: false
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 1