Feature: use github actions

This commit is contained in:
Dreamacro 2019-12-02 01:20:59 +08:00
parent af2f931f2c
commit 65cc8d47cb
3 changed files with 35 additions and 24 deletions

33
.github/workflows/node.yml vendored Normal file
View File

@ -0,0 +1,33 @@
name: Deploy
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Dashboard code
uses: actions/checkout@v1
- name: Setup Nodejs
uses: actions/setup-node@v1
with:
node-version: '13.x'
- name: Reuse Cache
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install package
run: |
npm ci
npm run build
- name: Deploy
uses: crazy-max/ghaction-github-pages@v1
with:
target_branch: gh-pages
build_dir: dist
fqdn: clash.razord.top
env:
GITHUB_PAT: ${{ secrets.GITHUB_PAT }}

View File

@ -1,22 +0,0 @@
language: node_js
sudo: false
node_js:
- "stable"
cache:
directories:
- "$HOME/.npm"
install:
- "npm ci"
script:
- "npm run lint"
before_deploy:
- "npm run build"
deploy:
provider: pages
skip-cleanup: true
local-dir: dist
github-token: $GITHUB_TOKEN
fqdn: clash.razord.top
on:
repo: Dreamacro/clash-dashboard
branch: master

View File

@ -8,8 +8,8 @@
<h4 align="center">Web Dashboard for Clash, now host on ClashX</h4> <h4 align="center">Web Dashboard for Clash, now host on ClashX</h4>
<p align="center"> <p align="center">
<a href="https://travis-ci.org/Dreamacro/clash-dashboard"> <a href="https://github.com/Dreamacro/clash-dashboard/actions">
<img src="https://travis-ci.org/Dreamacro/clash-dashboard.svg?branch=master" alt="Travis-CI"> <img src="https://github.com/Dreamacro/clash-dashboard/workflows/node/badge.svg" alt="Travis-CI">
</a> </a>
</p> </p>