-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (61 loc) · 2.04 KB
/
main.yaml
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
name: Main
on: [push]
jobs:
app:
name: Portfolio
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
lfs: true
- name: Set up direnv
run: |
curl -fsSL https://github.com/direnv/direnv/releases/latest/download/direnv.linux-amd64 | sudo tee /usr/local/bin/direnv > /dev/null
sudo chmod +x /usr/local/bin/direnv
echo > .env
direnv allow
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 17
- name: Cache .pnpm-store
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: pnpm-${{ hashFiles('./pnpm-lock.yaml') }}
- name: Set up pnpm
run: |
curl -fsSL https://pnpm.js.org/pnpm.js | node - add --global pnpm
pnpm install --frozen-lockfile
- name: Install deploy key
if: github.ref == 'refs/heads/main'
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.DEPLOY_KEY }}
name: id_rsa-deploy
known_hosts: unnecessary
config: |
Host github.com-deploy
HostName github.com
IdentityFile ~/.ssh/id_rsa-deploy
- name: Check
run: direnv exec . pnpm check
- name: Build
run: direnv exec . pnpm build
env:
ELM_APP_PORTFOLIO_GOOGLE_VERIFICATION: ${{ secrets.GOOGLE_VERIFICATION }}
- name: Deploy
if: github.ref == 'refs/heads/main'
run: |
git clone [email protected]:dcecile/dcecile.github.io.git gh-pages
cd gh-pages
git rm -rf --ignore-unmatch *
cp -r ../build/* .
cp ../README-compiled.md README.md
cp ../LICENSE.md .
git add .
git config --global user.email "[email protected]"
git config --global user.name "Dan Cecile (bot)"
git commit --allow-empty --message "Compiled from $(cd ..; git rev-parse --short HEAD) :robot:"
git push