Skip to content

Merge pull request #1 from junefish/patch-1 #249

Merge pull request #1 from junefish/patch-1

Merge pull request #1 from junefish/patch-1 #249

Workflow file for this run

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/[email protected]
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