Add Perseus final version (#276) #247
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy | |
on: | |
push: | |
branches: | |
- develop | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: A job to deploy blog. | |
# Do not run publish job in forks | |
if: github.repository_owner == 'SymbioticLab' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: true # Checkout private submodules(themes or something else). | |
- name: Setup node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 16 | |
# Caching dependencies to speed up workflows. (GitHub will remove any cache entries that have not been accessed in over 7 days.) | |
- name: Cache node modules | |
uses: actions/cache@v2 | |
id: cache | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install Dependencies | |
run: npm ci | |
- name: Setup SSH | |
env: | |
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} | |
run: | | |
mkdir -p ~/.ssh | |
echo "$DEPLOY_KEY" > ~/.ssh/id_rsa | |
chmod 600 ~/.ssh/id_rsa | |
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts | |
# Deploy. Note to pass commit message via env var such that | |
# it is properly quoted | |
- name: Deploy | |
env: | |
COMMIT_MESSAGE: ${{ github.event.head_commit.message }} | |
run: npm run deploy -- --msg "$COMMIT_MESSAGE" |