-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (43 loc) · 1.32 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
name: Install and Deploy Profile App
on:
push:
branches:
- main
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Git Configs
run: |
git config --global user.email "[email protected]"
git config --global user.name "Andrew Hummel"
git remote set-url origin [email protected]:ahummel25/profile.git
- name: Setup SSH Keys
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '18'
check-latest: true
- name: Cache NPM dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.OS }}-npm-cache-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-npm-cache-
- name: NPM Install
run: npm install --force
- name: NPM Test
run: npm test
- name: NPM Deploy
env:
GATSBY_GOOGLE_ANALYTICS_ID: ${{ secrets.GOOGLE_ANALYTICS_ID }}
GATSBY_WEATHER_API_KEY: ${{ secrets.WEATHER_API_KEY }}
run: |
echo Deploying as "$GITHUB_ACTOR" in repo "$GITHUB_REPOSITORY"
npm run deploy