-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert action to a composite action (#261)
## Problem Since I'm trying to build a custom action with multiple steps, it seems that I should've formatted my action.yml file to be a "composite" action. This PR does that. ## Type of Change - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update - [x] Infrastructure change (CI configs, etc) - [ ] Non-code change (docs, etc) - [ ] None of the above: (explain here)
- Loading branch information
Showing
1 changed file
with
65 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,71 +14,68 @@ inputs: | |
VERCEL_TEAM_SCOPE: | ||
required: true | ||
|
||
|
||
|
||
jobs: | ||
spin-up-vercel-app: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out current repository (pinecone-ts-client) | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18.20.3' | ||
|
||
- name: Setup Vercel | ||
uses: amondnet/setup-vercel@v25 | ||
env: | ||
VERCEL_TOKEN: ${{ inputs.VERCEL_TOKEN }} | ||
VERCEL_PROJECT_ID: ${{ inputs.VERCEL_PROJECT_ID }} | ||
VERCEL_ORG_ID: ${{ inputs.VERCEL_ORG_ID }} | ||
|
||
- name: Build pinecone-ts-client code | ||
run: npm run build | ||
|
||
- name: Package pinecone-ts-client code | ||
run: npm pack | ||
|
||
- name: Clone Pinecone Vercel app into pinecone-ts-client | ||
run: git clone [email protected]:pinecone-io/pinecone-rag-demo.git && cd pinecone-rag-demo && git pull origin main | ||
|
||
- name: Move package to pinecone-rag-demo | ||
run: mv pinecone-database-pinecone-*.tgz . | ||
|
||
- name: Install Pinecone Vercel app dependencies | ||
run: npm install | ||
|
||
- name: Install pinecone-ts-client "main" branch code into the Vercel app | ||
run: npm install pinecone-database-pinecone-*.tgz | ||
|
||
- name: Set up environment variables | ||
env: | ||
PINECONE_API_KEY: ${{ inputs.PINECONE_API_KEY }} | ||
PINECONE_REGION: us-west-2 | ||
PINECONE_INDEX: end-to-end-edge-test | ||
PINECONE_CLOUD: aws | ||
OPENAI_API_KEY: ${{ inputs.OPENAI_API_KEY }} | ||
|
||
- name: Install pnpm | ||
run: npm install -g pnpm | ||
|
||
- name: Install dependencies with pnpm | ||
run: pnpm install | ||
|
||
- name: Remove linting temporarily | ||
run: rm -rf .eslintrc.json | ||
|
||
- name: Build Pinecone Vercel app | ||
run: | | ||
pnpm run build | ||
- name: Install Vercel CLI | ||
run: pnpm add -g vercel | ||
|
||
- name: Deploy to Vercel | ||
env: | ||
VERCEL_TEAM_SCOPE: ${{ inputs.VERCEL_TEAM_SCOPE }} | ||
VERCEL_TOKEN: ${{ inputs.VERCEL_TOKEN }} | ||
run: vercel deploy --token=$VERCEL_TOKEN --scope=$VERCEL_TEAM_SCOPE | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Check out current repository (pinecone-ts-client) | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18.20.3' | ||
|
||
- name: Setup Vercel | ||
uses: amondnet/setup-vercel@v25 | ||
env: | ||
VERCEL_TOKEN: ${{ inputs.VERCEL_TOKEN }} | ||
VERCEL_PROJECT_ID: ${{ inputs.VERCEL_PROJECT_ID }} | ||
VERCEL_ORG_ID: ${{ inputs.VERCEL_ORG_ID }} | ||
|
||
- name: Build pinecone-ts-client code | ||
run: npm run build | ||
|
||
- name: Package pinecone-ts-client code | ||
run: npm pack | ||
|
||
- name: Clone Pinecone Vercel app into pinecone-ts-client | ||
run: git clone [email protected]:pinecone-io/pinecone-rag-demo.git && cd pinecone-rag-demo && git pull origin main | ||
|
||
- name: Move package to pinecone-rag-demo | ||
run: mv pinecone-database-pinecone-*.tgz . | ||
|
||
- name: Install Pinecone Vercel app dependencies | ||
run: npm install | ||
|
||
- name: Install pinecone-ts-client "main" branch code into the Vercel app | ||
run: npm install pinecone-database-pinecone-*.tgz | ||
|
||
- name: Set up environment variables | ||
env: | ||
PINECONE_API_KEY: ${{ inputs.PINECONE_API_KEY }} | ||
PINECONE_REGION: us-west-2 | ||
PINECONE_INDEX: end-to-end-edge-test | ||
PINECONE_CLOUD: aws | ||
OPENAI_API_KEY: ${{ inputs.OPENAI_API_KEY }} | ||
|
||
- name: Install pnpm | ||
run: npm install -g pnpm | ||
|
||
- name: Install dependencies with pnpm | ||
run: pnpm install | ||
|
||
- name: Remove linting temporarily | ||
run: rm -rf .eslintrc.json | ||
|
||
- name: Build Pinecone Vercel app | ||
run: | | ||
pnpm run build | ||
- name: Install Vercel CLI | ||
run: pnpm add -g vercel | ||
|
||
- name: Deploy to Vercel | ||
env: | ||
VERCEL_TEAM_SCOPE: ${{ inputs.VERCEL_TEAM_SCOPE }} | ||
VERCEL_TOKEN: ${{ inputs.VERCEL_TOKEN }} | ||
run: vercel deploy --token=$VERCEL_TOKEN --scope=$VERCEL_TEAM_SCOPE |