Skip to content

Commit

Permalink
ci: publish openapi specs to vercel (#457)
Browse files Browse the repository at this point in the history
* ci: publish vercel for apis

* vercel branch

* node v

* move to api dir

* remove build

* remove branch trigger

* remove environments

* rename job
  • Loading branch information
rafaelcr authored Mar 5, 2025
1 parent d527b28 commit 16e8838
Show file tree
Hide file tree
Showing 8 changed files with 601 additions and 76 deletions.
64 changes: 0 additions & 64 deletions .github/workflows/pkg-version-bump.yaml

This file was deleted.

55 changes: 55 additions & 0 deletions .github/workflows/vercel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Vercel

env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}

on:
push:
branches:
- beta
- develop
pull_request:
release:
types:
- published
workflow_dispatch:

jobs:
openapi-publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '20'

- name: Install Vercel CLI
run: npm install --global vercel@latest

- name: Pull Vercel environment information
run: vercel pull --yes --environment=${{ github.ref_name == 'main' && 'production' || 'preview' }} --token=${{ secrets.VERCEL_TOKEN }}

- name: Build project artifacts
run: vercel build ${{ github.ref_name == 'main' && '--prod' || '' }} --token=${{ secrets.VERCEL_TOKEN }}

- name: Deploy project artifacts to Vercel
id: deploy
run: vercel ${{ github.ref_name == 'main' && '--prod' || 'deploy' }} --prebuilt --token=${{ secrets.VERCEL_TOKEN }} | awk '{print "deployment_url="$1}' >> $GITHUB_OUTPUT

- name: Trigger docs.hiro.so deployment
if: github.ref_name == 'main'
run: curl -X POST ${{ secrets.VERCEL_DOCS_DEPLOY_HOOK_URL }}

- name: Add comment with Vercel deployment URL
if: ${{ github.event_name == 'pull_request' }}
uses: thollander/actions-comment-pull-request@v2
with:
comment_tag: vercel
message: |
Vercel deployment URL: ${{ steps.deploy.outputs.deployment_url }} :rocket:
21 changes: 19 additions & 2 deletions api/ordinals/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 16e8838

Please sign in to comment.