From 78b4606443e1b0b567caa1f3560b24c287698eab Mon Sep 17 00:00:00 2001 From: Mix <32300164+mnixry@users.noreply.github.com> Date: Fri, 11 Sep 2020 23:35:44 +0800 Subject: [PATCH] Add CI to automatic build dist files --- .github/workflows/ci.yml | 46 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..60f9a4e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,46 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Vue CI + +on: + - push + - pull_request + +env: + WARN_ON_PR: "artifact upload is disabled due to the workflow is trigged by pull request." + +jobs: + build: + name: Build dist + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Prepare Node.js environment + uses: actions/setup-node@v1 + + - name: Cache node modules + uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: '${{ runner.os }}-' + + - name: Install dependencies + run: 'npm install' + + - name: Build dist files + run: | + if ${{ !!github.head_ref }}; then echo "::warning:: $WARN_ON_PR"; fi + npm run build + + - name: Upload dist + uses: actions/upload-artifact@v2 + with: + name: dist + path: ./dist/* + + +