Skip to content

feat: outfit builder rework, can now add items, updated workflows #71

feat: outfit builder rework, can now add items, updated workflows

feat: outfit builder rework, can now add items, updated workflows #71

name: Hono Integration
on:
pull_request
env:
NEON_DATABASE_USERNAME: ${{ secrets.NEON_DATABASE_USERNAME }}
NEON_DATABASE_NAME: ${{ secrets.NEON_DATABASE_NAME }}
NEON_PROJECT_ID: ${{ secrets.NEON_PROJECT_ID }}
NEON_API_TOKEN: ${{ secrets.NEON_API_TOKEN }}
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
CLERK_PUBLISHABLE_KEY: ${{ vars.CLERK_PUBLISHABLE_KEY }}
CLERK_SECRET_KEY: ${{ secrets.CLERK_SECRET_KEY }}
DEPLOY_TAG: shafa-hono-stage-${{ github.event.number }}
DEPLOY_ROUTE: https://shafa-hono-stage-${{ github.event.number }}.radicalplatforms.workers.dev
jobs:
format_checks:
name: Format Checks
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
cache-dependency-path: hono/package-lock.json
- name: Install Dependencies
run: npm ci
working-directory: hono
- name: Check Prettier
run: npm run check-prettier
working-directory: hono
- name: Check ESLint
run: npm run check-eslint
working-directory: hono
compilation_checks:
name: Compilation Checks
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
cache-dependency-path: hono/package-lock.json
- name: Install Dependencies
run: npm ci
working-directory: hono
- name: Check TS Compilation
run: npm run check-ts
working-directory: hono
# test_smoke:
# name: Test Smoke
# runs-on: ubuntu-latest
# needs: [format_checks, compilation_checks]
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - uses: actions/setup-node@v4
# with:
# node-version: 18
# cache: 'npm'
# cache-dependency-path: hono/package-lock.json
# - uses: ankane/setup-postgres@v1
# with:
# postgres-version: 16
# - name: Install Dependencies
# run: npm ci
# working-directory: hono
# - name: Run Smoke Tests
# run: npm run test:smoke
# working-directory: hono
# test_matrix:
# name: Test Matrix
# runs-on: ubuntu-latest
# needs: test_smoke
# strategy:
# matrix:
# test: [ unit, integration, preflight ]
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - uses: actions/setup-node@v4
# with:
# node-version: 18
# cache: 'npm'
# cache-dependency-path: hono/package-lock.json
# - uses: ankane/setup-postgres@v1
# with:
# postgres-version: 16
# - name: Install Dependencies
# run: npm ci
# working-directory: hono
# - name: Run Tests
# run: npm run test:${{ matrix.test }}
# working-directory: hono
cf_deploy_hono_stage:
name: Deploy Hono to Stage
runs-on: ubuntu-latest
needs: [format_checks, compilation_checks]
environment:
name: hono-stage-${{ github.event.number }}
url: ${{ env.DEPLOY_ROUTE }}
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
cache-dependency-path: hono/package-lock.json
- name: Install Dependencies
run: npm ci
working-directory: hono
- uses: pnpm/action-setup@v3
with:
version: 8
- name: Create Neon Branch
uses: neondatabase/create-branch-action@v4
id: create-branch
with:
project_id: ${{ env.NEON_PROJECT_ID }}
branch_name: ${{ env.DEPLOY_TAG }}
database: ${{ env.NEON_DATABASE_NAME }}
username: ${{ env.NEON_DATABASE_USERNAME }}
api_key: ${{ env.NEON_API_TOKEN }}
- name: Run Migrations
env:
DATABASE_URL: ${{ steps.create-branch.outputs.db_url }}?sslmode=require
run: npm run migrate
working-directory: hono
- name: Deploy Hono
uses: cloudflare/wrangler-action@v3
env:
DATABASE_URL: ${{ steps.create-branch.outputs.db_url }}?sslmode=require
with:
apiToken: ${{ env.CF_API_TOKEN }}
command: deploy --name ${{ env.DEPLOY_TAG }}
workingDirectory: hono
packageManager: pnpm
postCommands: |
echo "${{ env.DATABASE_URL }}" | pnpm wrangler secret put DATABASE_URL --name ${{ env.DEPLOY_TAG }}
echo "${{ env.CLERK_PUBLISHABLE_KEY }}" | pnpm wrangler secret put CLERK_PUBLISHABLE_KEY --name ${{ env.DEPLOY_TAG }}
echo "${{ env.CLERK_SECRET_KEY }}" | pnpm wrangler secret put CLERK_SECRET_KEY --name ${{ env.DEPLOY_TAG }}