mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-18 10:22:00 +00:00
feat(install): deploy installer to install.ohmyz.sh (#11722)
Co-authored-by: Marc Cornellà <hello@mcornella.com>
This commit is contained in:
parent
0024107310
commit
6101106916
5 changed files with 72 additions and 2 deletions
55
.github/workflows/installer.yml
vendored
Normal file
55
.github/workflows/installer.yml
vendored
Normal file
|
@ -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 }}
|
1
.github/workflows/installer/.gitignore
vendored
Normal file
1
.github/workflows/installer/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
install.sh
|
2
.github/workflows/installer/.vercelignore
vendored
Normal file
2
.github/workflows/installer/.vercelignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
/*
|
||||||
|
!/install.sh
|
14
.github/workflows/installer/vercel.json
vendored
Normal file
14
.github/workflows/installer/vercel.json
vendored
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"headers": [
|
||||||
|
{
|
||||||
|
"source": "/((?!favicon.ico).*)",
|
||||||
|
"headers": [{ "key": "Content-Type", "value": "text/plain" }]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"rewrites": [
|
||||||
|
{
|
||||||
|
"source": "/((?!favicon.ico|install.sh).*)",
|
||||||
|
"destination": "/install.sh"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
|
@ -31,8 +31,6 @@ jobs:
|
||||||
- name: Install zsh
|
- name: Install zsh
|
||||||
if: runner.os == 'Linux'
|
if: runner.os == 'Linux'
|
||||||
run: sudo apt-get update; sudo apt-get install zsh
|
run: sudo apt-get update; sudo apt-get install zsh
|
||||||
- name: Test installer
|
|
||||||
run: sh ./tools/install.sh
|
|
||||||
- name: Check syntax
|
- name: Check syntax
|
||||||
run: |
|
run: |
|
||||||
for file in ./oh-my-zsh.sh \
|
for file in ./oh-my-zsh.sh \
|
||||||
|
|
Loading…
Reference in a new issue