-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (47 loc) · 1.46 KB
/
ghp.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
name: Build + Deploy
on:
push:
branches: [dev,main,ghp]
jobs:
build:
name: Build + Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
- run: echo "node_modules/.bin:$PATH" >> $GITHUB_PATH
- run: npm ci
- run: next build
- run: next export
- run: ./write-redirects.js
- run: touch ./out/.nojekyll
if: github.ref_name == 'ghp'
- name: Deploy GitHub Pages
if: github.ref_name == 'ghp'
uses: JamesIves/github-pages-deploy-action@4.1.0
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: out
- name: Setup SSH configs
if: github.ref_name == 'dev' || github.ref_name == 'main'
env:
SSH_PRIVKEY: ${{ secrets.SSH_PRIVKEY }}
SSH_CONFIG: ${{ secrets.SSH_CONFIG }}
SSH_KNOWN_HOSTS: ${{ secrets.SSH_KNOWN_HOSTS }}
run: |
mkdir -p ~/.ssh
echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
echo "$SSH_CONFIG" > ~/.ssh/config
echo "$SSH_PRIVKEY" > ~/.ssh/bikejc.org
chmod 600 ~/.ssh/bikejc.org
ls -l ~/.ssh
- name: Deploy FTP (dev.bikejc.org)
if: github.ref_name == 'dev'
run: npm run deploy-dev
- name: Deploy FTP (bikejc.org)
if: github.ref_name == 'main'
run: npm run deploy-main