build-test-site.yaml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. name: Continuous Integration
  2. on:
  3. push:
  4. branches:
  5. - master
  6. paths:
  7. - 'wowchemy/**'
  8. pull_request:
  9. branches:
  10. - master
  11. paths:
  12. - 'wowchemy/**'
  13. jobs:
  14. build:
  15. runs-on: ${{ matrix.os }}
  16. strategy:
  17. matrix:
  18. os: [ubuntu-latest]
  19. node-version: [15.x]
  20. steps:
  21. - uses: actions/checkout@v2
  22. with:
  23. submodules: true # Fetch any Git submodules (true OR recursive)
  24. fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
  25. - name: Use Node.js ${{ matrix.node-version }}
  26. uses: actions/setup-node@v1
  27. with:
  28. node-version: ${{ matrix.node-version }}
  29. - name: Install JS dependencies
  30. run: npm ci
  31. working-directory: ./wowchemy
  32. - name: Check for JS linting errors
  33. run: npm lint:js
  34. working-directory: ./wowchemy
  35. format:
  36. runs-on: ubuntu-latest
  37. steps:
  38. - name: Checkout
  39. uses: actions/checkout@v2
  40. with:
  41. # Make sure the actual branch is checked out when running on pull requests
  42. ref: ${{ github.head_ref }}
  43. - name: Prettify code
  44. uses: creyD/prettier_action@v3.1
  45. with:
  46. prettier_options: '--write "wowchemy/*.{css,js,json,md,scss}" "wowchemy/**/*.{css,js,json,md,scss}"' # Match package.json
  47. prettier_version: '2.2.1' # Match package.json
  48. commit_message: 'refactor: format code'
  49. env:
  50. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  51. hugo:
  52. runs-on: ubuntu-latest
  53. steps:
  54. - uses: actions/checkout@v2
  55. with:
  56. submodules: true # Fetch any Git submodules (true OR recursive)
  57. fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
  58. - name: Setup Hugo
  59. uses: peaceiris/actions-hugo@v2
  60. with:
  61. hugo-version: 'latest'
  62. extended: true
  63. - name: Build
  64. run: hugo --minify
  65. working-directory: ./wowchemy/test