Skip to content

Commit

Permalink
Convert action to a composite action (#261)
Browse files Browse the repository at this point in the history
## 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
aulorbe authored Aug 27, 2024
1 parent a8e46e8 commit 554958d
Showing 1 changed file with 65 additions and 68 deletions.
133 changes: 65 additions & 68 deletions .github/actions/e2e-testing/edge/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 554958d

Please sign in to comment.