summaryrefslogtreecommitdiff
path: root/.github/workflows/installer.yml
diff options
context:
space:
mode:
authorCarlo Sala <carlosalag@protonmail.com>2023-06-02 21:37:48 +0200
committerGitHub <noreply@github.com>2023-06-02 21:37:48 +0200
commit6101106916147b1716ff2d5de4a53260e7607bae (patch)
tree57eb922a1c7f0a9fb70fd69840fa0be25c38597a /.github/workflows/installer.yml
parent00241073105643874531e1826b7df6d2cb3cadfb (diff)
downloadzsh-6101106916147b1716ff2d5de4a53260e7607bae.tar.gz
zsh-6101106916147b1716ff2d5de4a53260e7607bae.tar.bz2
zsh-6101106916147b1716ff2d5de4a53260e7607bae.zip
feat(install): deploy installer to install.ohmyz.sh (#11722)
Co-authored-by: Marc Cornellà <hello@mcornella.com>
Diffstat (limited to '.github/workflows/installer.yml')
-rw-r--r--.github/workflows/installer.yml55
1 files changed, 55 insertions, 0 deletions
diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml
new file mode 100644
index 000000000..ac88d10b0
--- /dev/null
+++ b/.github/workflows/installer.yml
@@ -0,0 +1,55 @@
+name: Test and Deploy installer
+on:
+ workflow_dispatch: {}
+ push:
+ paths:
+ - tools/install.sh
+ - .github/workflows/installer
+ - .github/workflows/installer.yml
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
+ cancel-in-progress: false
+
+permissions:
+ contents: read # to checkout
+
+jobs:
+ test:
+ name: Test installer
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix:
+ os:
+ - ubuntu-latest
+ - macos-latest
+ steps:
+ - name: Set up git repository
+ uses: actions/checkout@v3
+ - name: Install zsh
+ if: runner.os == 'Linux'
+ run: sudo apt-get update; sudo apt-get install zsh
+ - name: Test installer
+ run: sh ./tools/install.sh
+
+ deploy:
+ name: Deploy installer in install.ohmyz.sh
+ if: github.ref == 'refs/heads/master'
+ runs-on: ubuntu-latest
+ environment: vercel
+ needs:
+ - test
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+ - name: Install Vercel CLI
+ run: npm install -g vercel
+ - name: Setup project and deploy
+ env:
+ VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
+ VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
+ run: |
+ cp tools/install.sh .github/workflows/installer/install.sh
+ cd .github/workflows/installer
+ vc link --yes -t ${{ secrets.VERCEL_TOKEN }}
+ vc deploy --prod -t ${{ secrets.VERCEL_TOKEN }}