-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (46 loc) · 1.46 KB
/
build.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
name: Build Exported
on:
push:
branches:
- "release"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- name: Install deps
run: npm ci
- name: replace path
run: sed -ri 's/\/plasmic\/shinkan_next\/images/\/\~shinkan-web\/plasmic\/shinkan_next\/images/g' $(find components -type f)
- name: set .env file
run: echo -ne "NEXT_PUBLIC_GOOGLE_ANALYTICS_ID=UA-162922927-1\nNEXT_PUBLIC_BASEPATH=/~shinkan-web" > .env.local
- name: build & export
run: npx next build && npx next export
- name: duplicate dirs
run: |
cd out/org
for id in ./*.html; do
mkdir ${id:2:-5}
cp $id ${id:2:-5}/index.html
done
cp ../org.html ./index.html
- name: upload artifact
uses: actions/upload-artifact@v2
with:
name: out
path: out
- name: install sshpass
run: sudo apt-get -y install sshpass
- name: upload to server
run: sshpass -e scp -o StrictHostKeyChecking=no -r out/* [email protected]:.
env:
SSHPASS: ${{ secrets.SFTP_PASSWORD }}