installer.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. name: Test and Deploy installer
  2. on:
  3. workflow_dispatch: {}
  4. push:
  5. paths:
  6. - tools/install.sh
  7. - .github/workflows/installer
  8. - .github/workflows/installer.yml
  9. concurrency:
  10. group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
  11. cancel-in-progress: false
  12. permissions:
  13. contents: read # to checkout
  14. jobs:
  15. test:
  16. name: Test installer
  17. runs-on: ${{ matrix.os }}
  18. strategy:
  19. matrix:
  20. os:
  21. - ubuntu-latest
  22. - macos-latest
  23. steps:
  24. - name: Set up git repository
  25. uses: actions/checkout@v3
  26. - name: Install zsh
  27. if: runner.os == 'Linux'
  28. run: sudo apt-get update; sudo apt-get install zsh
  29. - name: Test installer
  30. run: sh ./tools/install.sh
  31. deploy:
  32. name: Deploy installer in install.ohmyz.sh
  33. if: github.ref == 'refs/heads/master'
  34. runs-on: ubuntu-latest
  35. environment: vercel
  36. needs:
  37. - test
  38. steps:
  39. - name: Checkout
  40. uses: actions/checkout@v3
  41. - name: Install Vercel CLI
  42. run: npm install -g vercel
  43. - name: Setup project and deploy
  44. env:
  45. VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
  46. VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
  47. run: |
  48. cp tools/install.sh .github/workflows/installer/install.sh
  49. cd .github/workflows/installer
  50. vc link --yes -t ${{ secrets.VERCEL_TOKEN }}
  51. vc deploy --prod -t ${{ secrets.VERCEL_TOKEN }}