Switch to yarn and new github action
This commit is contained in:
66
.github/workflows/deploy.yml
vendored
66
.github/workflows/deploy.yml
vendored
@@ -1,53 +1,37 @@
|
|||||||
name: deploy
|
name: Deploy to GitHub Pages
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
|
||||||
branches: [main]
|
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
|
paths: [website/**]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
checks:
|
deploy:
|
||||||
if: github.event_name != 'push'
|
name: Deploy to GitHub Pages
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-node@v1
|
- uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: '12.x'
|
node-version: 14.x
|
||||||
- name: Test Build
|
cache: yarn
|
||||||
|
- name: Build website
|
||||||
|
working-directory: website
|
||||||
run: |
|
run: |
|
||||||
if [ -e yarn.lock ]; then
|
|
||||||
yarn install --frozen-lockfile
|
yarn install --frozen-lockfile
|
||||||
elif [ -e package-lock.json ]; then
|
yarn build
|
||||||
npm ci
|
|
||||||
else
|
# Popular action to deploy to GitHub Pages:
|
||||||
npm i
|
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
|
||||||
fi
|
- name: Deploy to GitHub Pages
|
||||||
npm run build
|
uses: peaceiris/actions-gh-pages@v3
|
||||||
gh-release:
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v1
|
|
||||||
- uses: actions/setup-node@v1
|
|
||||||
with:
|
with:
|
||||||
node-version: '12.x'
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- uses: webfactory/ssh-agent@v0.5.0
|
# Build output to publish to the `gh-pages` branch:
|
||||||
with:
|
publish_dir: ./website/build
|
||||||
ssh-private-key: ${{ secrets.GH_PAGES_DEPLOY }}
|
# Assign commit authorship to the official GH-Actions bot for deploys to `gh-pages` branch:
|
||||||
- name: Release to GitHub Pages
|
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
|
||||||
env:
|
# The GH actions bot is used by default if you didn't specify the two fields.
|
||||||
USE_SSH: true
|
# You can swap them out with your own user credentials.
|
||||||
GIT_USER: git
|
user_name: github-actions[bot]
|
||||||
run: |
|
user_email: 41898282+github-actions[bot]@users.noreply.github.com
|
||||||
git config --global user.email "technobaboo@gmail.com"
|
|
||||||
git config --global user.name "technobaboo"
|
|
||||||
if [ -e yarn.lock ]; then
|
|
||||||
yarn install --frozen-lockfile
|
|
||||||
elif [ -e package-lock.json ]; then
|
|
||||||
npm ci
|
|
||||||
else
|
|
||||||
npm i
|
|
||||||
fi
|
|
||||||
npm run deploy
|
|
||||||
26440
package-lock.json
generated
26440
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user