Skip to content

CI

CI #179

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the v2 branch
push:
branches: [ v2 ]
pull_request:
branches: [ v2 ]
create:
tags:
- v*
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Setup Node.js environment
uses: actions/setup-node@v2.1.5
with:
# Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0
node-version: 14.x
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: node_modules
key: ${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
- name: npm install
run: npm install
- name: set version
if: startsWith(github.ref, 'refs/tags/')
run: export version=$(git describe --abbrev=0 --tags) && sed -i "s/#VERSION#/$version/" demo/components/version.js
- name: build
run: npm run build:demo
- name: Deploy
uses: garygrossgarten/github-action-scp@release
if: startsWith(github.repository, 'langhuihui')
with:
local: /home/runner/work/jessibuca/jessibuca/demo/.vitepress/dist
remote: /opt/jessibuca/demo/.vitepress/dist
host: monibuca.com
username: root
privateKey: ${{ secrets.PEM }}
- name: zip
if: startsWith(github.ref, 'refs/tags/')
run: zip -r ./demo.zip demo/public/*
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: "demo.zip"
- name: zip2
if: startsWith(github.ref, 'refs/tags/')
run: zip -r ./dist.zip dist/*
- name: Release2
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: "dist.zip"
- name: zip3
if: startsWith(github.ref, 'refs/tags/')
run: zip -r ./pro.zip demo/public/pro/*
- name: Release3
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: "pro.zip"