installer.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 deploy --prod -t ${{ secrets.VERCEL_TOKEN }}