main.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. name: Build and Deploy
  2. on: [push, pull_request, pull_request_target]
  3. jobs:
  4. yamllint:
  5. runs-on: ubuntu-latest
  6. steps:
  7. - name: Checkout
  8. uses: actions/checkout@master
  9. - name: Yamllint
  10. uses: ibiqlik/action-yamllint@v3
  11. with:
  12. file_or_dir: games/*.yaml originals/*.yaml schema/*.yaml
  13. env:
  14. GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  15. build:
  16. runs-on: ubuntu-latest
  17. steps:
  18. - name: Checkout
  19. uses: actions/checkout@master
  20. - name: Install poetry
  21. run: pipx install poetry
  22. - name: Setup Python
  23. uses: actions/setup-python@v4
  24. with:
  25. python-version: '3.12'
  26. cache: 'poetry'
  27. - name: Build
  28. run: |
  29. make ci
  30. test 6000 -lt $(cat _build/index.html | wc -l)
  31. yarn install
  32. yarn danger ci
  33. env:
  34. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  35. DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  36. - name: Minify
  37. run: make min
  38. - uses: actions/upload-pages-artifact@v1
  39. with:
  40. path: _build
  41. deploy:
  42. runs-on: ubuntu-latest
  43. needs: build
  44. if: github.ref == 'refs/heads/master'
  45. permissions:
  46. pages: write
  47. id-token: write
  48. environment:
  49. name: github-pages
  50. url: ${{ steps.deployment.outputs.page_url }}
  51. steps:
  52. - name: Deploy to GitHub Pages
  53. id: deployment
  54. uses: actions/deploy-pages@v1