Skip to content

Commit

Permalink
build image
Browse files Browse the repository at this point in the history
  • Loading branch information
zuisong committed Jan 9, 2024
1 parent 4c0e367 commit 63995b3
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 1 deletion.
54 changes: 54 additions & 0 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build Image

permissions:
contents: read
packages: write

on:
push:
tags:
- v[0-9]+.*

env:
IMAGE_TAG: ${{ github.ref_name }}
IMAGE_NAME: ghcr.io/${{ github.repository }}

jobs:
create-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/create-gh-release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
build-image:
strategy:
fail-fast: false
matrix:
include:
- runtime: deno
- runtime: node
- runtime: bun
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile_${{ matrix.runtime }}
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}_${{ matrix.runtime }}
6 changes: 6 additions & 0 deletions Dockerfile_bun
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ARG BUN_VERSION=1
FROM oven/bun:${BUN_VERSION}
WORKDIR /data
COPY . .
RUN bun install
CMD bun run start:bun
File renamed without changes.
6 changes: 6 additions & 0 deletions Dockerfile_node
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ARG NODE_VERSION=21
FROM node:${NODE_VERSION}
WORKDIR /data
COPY . .
RUN npm install
CMD npm run start:node
1 change: 1 addition & 0 deletions deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"imports": {
"@google/generative-ai": "npm:/@google/generative-ai",
"hono/": "npm:/hono/",
"hono": "npm:/hono",
"loglevel": "npm:/loglevel",
"openai": "npm:/openai"
},
Expand Down
2 changes: 1 addition & 1 deletion src/app.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Hono } from "hono/"
import { Hono } from "hono"
import { cors } from "hono/cors"
import { getRuntimeKey } from "hono/adapter"
import { logger } from "hono/logger"
Expand Down

0 comments on commit 63995b3

Please sign in to comment.