installer.yml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. if: github.repository == 'ohmyzsh/ohmyzsh'
  18. runs-on: ${{ matrix.os }}
  19. strategy:
  20. matrix:
  21. os:
  22. - ubuntu-latest
  23. - macos-latest
  24. steps:
  25. - name: Set up git repository
  26. uses: actions/checkout@v4
  27. - name: Install zsh
  28. if: runner.os == 'Linux'
  29. run: sudo apt-get update; sudo apt-get install zsh
  30. - name: Test installer
  31. run: sh ./tools/install.sh
  32. deploy:
  33. name: Deploy installer in install.ohmyz.sh
  34. if: github.ref == 'refs/heads/master'
  35. runs-on: ubuntu-latest
  36. environment: vercel
  37. needs:
  38. - test
  39. steps:
  40. - name: Checkout
  41. uses: actions/checkout@v4
  42. - name: Install Vercel CLI
  43. run: npm install -g vercel
  44. - name: Setup project and deploy
  45. env:
  46. VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
  47. VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
  48. VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
  49. run: |
  50. cp tools/install.sh .github/workflows/installer/install.sh
  51. cd .github/workflows/installer
  52. vc deploy --prod -t "$VERCEL_TOKEN"