From c1d983ca1c86e24bc7bead88a6ab8834f1a27a2d Mon Sep 17 00:00:00 2001 From: 94dreamer <503633021@qq.com> Date: Fri, 26 Nov 2021 11:40:26 +0800 Subject: [PATCH] ci: add githubactions --- .github/dependabot.yml | 20 ++++++++++++++++++++ .github/workflows/pull-request.yml | 12 ++++++++++++ .github/workflows/push.yml | 19 +++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/pull-request.yml create mode 100644 .github/workflows/push.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..c37a937 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,20 @@ +# Basic dependabot.yml file with +# minimum configuration for two package managers + +version: 2 +updates: + # Enable version updates for npm + - package-ecosystem: "npm" + # Look for `package.json` and `lock` files in the `root` directory + directory: "/" + # Check the npm registry for updates every day (weekdays) + schedule: + interval: "monthly" + + # Enable version updates for Docker + - package-ecosystem: "docker" + # Look for a `Dockerfile` in the `root` directory + directory: "/" + # Check for updates once a week + schedule: + interval: "monthly" diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 0000000..576eaa3 --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,12 @@ +name: MAIN_PULL_REQUEST + +on: + pull_request: + branches: [develop, main] + +jobs: + MAIN_PULL_REQUEST: + runs-on: ubuntu-latest + steps: + - uses: actions/install-dep@develop + - run: npm run lint diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml new file mode 100644 index 0000000..b0a5ec9 --- /dev/null +++ b/.github/workflows/push.yml @@ -0,0 +1,19 @@ +name: All_ON_PUSH + +on: push +jobs: + All_ON_PUSH: + runs-on: ubuntu-latest + steps: + - uses: actions/install-dep@develop + - run: echo '${{ github.ref }} ... ${{ github.sha }}'' + - name: build + run: npm run build + - name: upload surge service + id: deploy + run: | + export DEPLOY_DOMAIN=https://preview-${{ github.ref }}-tdesign-vue.surge.sh + npx surge --project dist --domain $DEPLOY_DOMAIN --token ${{ secrets.SURGE_TOKEN }} + - run: echo 'https://preview-${{ github.ref }}-tdesign-vue.surge.sh' + if: ${{ success() }} + - run: echo "🍏 This job's status is ${{ job.status }}."