vue_deploy.yml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. name: Vue Project Deploy With Docker Image
  2. on:
  3. push:
  4. branches: [ master ]
  5. paths-ignore:
  6. - '**/README.md'
  7. - '**/*.yml'
  8. tags: [release-v*]
  9. pull_request:
  10. branches: [master]
  11. jobs:
  12. build_vue:
  13. runs-on: ubuntu-latest
  14. defaults:
  15. run:
  16. working-directory: front
  17. strategy:
  18. matrix:
  19. node-version: [12.x]
  20. steps:
  21. - uses: actions/checkout@v2
  22. - name: User Node.js ${{natrix.node-version}}
  23. users: actions/setup=node@v1
  24. with:
  25. node-version: ${{matrix.node-version}}
  26. - name: npm Build
  27. run: |
  28. npm install
  29. npn run build
  30. - uses: actions/upload-artifact@v2
  31. with:
  32. name: distfile
  33. path: front/dist
  34. docker_image:
  35. needs: [build_vue]
  36. runs-on: ubuntu-latest
  37. steps:
  38. - uses: actions/checkout@v2
  39. - uses: actions/download-artifact@v2
  40. with:
  41. name: distfile
  42. path: wwwroot
  43. - name: Push to Docker Hub
  44. uses: docker/build-push-acation@v1
  45. with:
  46. username: ${{secrets.DOCKER_HUB_NAME}}
  47. password: ${{secrets.DOCKER_HUB_PASSWORD}}
  48. repository: jianboy/vue_demo
  49. tags: test