wireguard-dashboard-admin/.github/workflows/deploy.yml

50 lines
1.2 KiB
YAML
Raw Normal View History

name: deploy
2022-04-09 22:37:44 +08:00
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
2022-04-09 22:37:44 +08:00
- name: Checkout
uses: actions/checkout@v2
2022-04-09 22:37:44 +08:00
- name: use Node.js 16
uses: actions/setup-node@v2.1.2
with:
node-version: '16.x'
2022-04-09 22:59:05 +08:00
- name: use pnpm 6.32.2
uses: pnpm/action-setup@v2.2.1
with:
version: 6.32.2
2022-04-09 23:14:02 +08:00
- name: Set SSH Environment
env:
DOCS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
run: |
mkdir -p ~/.ssh/
echo "$ACTIONS_DEPLOY_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan github.com > ~/.ssh/known_hosts
chmod 700 ~/.ssh && chmod 600 ~/.ssh/*
git config --local user.email "zclzone@outlook.com"
git config --local user.name "zclzone"
2022-04-09 22:37:44 +08:00
- name: Build
run: |
pnpm install
2022-04-09 22:59:05 +08:00
pnpm run build:github
2022-04-09 22:37:44 +08:00
- name: Deploy
uses: peaceiris/actions-gh-pages@v2.5.0
env:
2022-04-09 23:14:02 +08:00
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
2022-04-09 22:37:44 +08:00
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./dist
with:
forceOrphan: true