main.yml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. name: CI
  2. on:
  3. push:
  4. branches: [ master ]
  5. jobs:
  6. Build:
  7. name: Build
  8. runs-on: ubuntu-latest
  9. steps:
  10. - name: Checkout Source
  11. uses: actions/checkout@v2
  12. with:
  13. fetch-depth: 1
  14. - name: Setup Node.js environment
  15. uses: actions/setup-node@v1
  16. with:
  17. node-version: "12"
  18. - name: Save & Restore Npm Package Cache
  19. uses: actions/cache@v2
  20. with:
  21. path: ~/.npm
  22. key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
  23. restore-keys: |
  24. ${{ runner.os }}-node-
  25. - name: Install Dependencies
  26. run: npm install
  27. - name: Build
  28. run: npm run build
  29. - name: Deploy
  30. run: |
  31. cd dist
  32. git init
  33. git config user.name "${{ secrets.GIT_USER_NAME }}"
  34. git config user.email "${{ secrets.GIT_USER_EMAIL }}"
  35. git add .
  36. git commit -m "deploy"
  37. git push -f -q "https://${{ secrets.ACCESS_TOKEN }}@github.com/vue-admin-beautiful/vue-admin-beautiful-pro.git" master:gh-pages