Skip to content

Commit

Permalink
feat: support hf auto deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
weaigc committed Jul 31, 2023
1 parent fb5037b commit 0346671
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 12 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build Docker Image

on:
push:
branches:
- main

jobs:
github:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- name: Login to github registry
uses: actions-hub/docker/login@master
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

- name: Build :latest
if: success()
run: docker build -t weaigc/bingo:latest .

- name: Push to docker hub :latest
if: success()
uses: actions-hub/docker@master
with:
args: push weaigc/bingo:latest
22 changes: 22 additions & 0 deletions .github/workflows/huggingface.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Sync to Hugging Face hub
on:
push:
branches: [main]

# to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
sync-to-hub:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
lfs: true
- name: Push to hub
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
HF_USERNAME: hf4all
SPACE_NAME: bingo
run: git push https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME main
17 changes: 8 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,30 @@ FROM node:18

ARG DEBIAN_FRONTEND=noninteractive

ENV BING_UA Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36 Edg/115.0.0.0
ENV BING_COOKIE ""
ENV BING_HEADER ""

# Set home to the user's home directory
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH

# Set up a new user named "user" with user ID 1000
RUN useradd -o -u 1000 user
RUN useradd -o -u 1000 user && mkdir -p $HOME/app && chown -R user $HOME

# Switch to the "user" user
USER user

# Set home to the user's home directory
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH

# Set the working directory to the user's home directory
WORKDIR $HOME/app

# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY --chown=user package*.json $HOME/app
COPY --chown=user package*.json $HOME/app/

RUN npm install

# Copy the current directory contents into the container at $HOME/app setting the owner to the user
COPY --chown=user . $HOME/app
COPY --chown=user . $HOME/app/

RUN npm run build

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ Bingo,一个让你呼吸顺畅 New Bing。

高度还原 New Bing 网页版的主要操作,国内可用,兼容绝大多数微软 Bing AI 的功能,可自行部署使用。

[![docker build](https://github.com/weaigc/bingo/actions/workflows/docker.yml/badge.svg)](https://hub.docker.com/repository/docker/weaigc/bingo/)
[![MIT License](https://img.shields.io/badge/license-MIT-97c50f)](https://github.com/weaigc/bingo/blob/main/license)


</div>

## 演示站点
Expand All @@ -28,7 +28,7 @@ Bingo,一个让你呼吸顺畅 New Bing。
* 站点三:https://bingo-beta-seven.vercel.app/ (此站点部署在 Vercel 上,由于[免费版本限制](https://vercel.com/docs/concepts/limits/overview),功能不一定正常,仅供参考)


[![img](./docs/images/demo2.png)](https://bing.github1s.tk)
[![img](./docs/images/demo.png)](https://bing.github1s.tk)

## 功能和特点

Expand Down Expand Up @@ -66,7 +66,7 @@ Bingo,一个让你呼吸顺畅 New Bing。
> 2. 方式二,Cloudflare Workers
<details>
<summary>
其它平台部署(由于其他平台目前遭到 new bing 封杀,会遇到更多问题,不再做推荐,有需要的可以通过此链接快速部署
其它平台部署(由于其他平台目前遭到 new bing 封杀,会遇到更多问题,不再做推荐,有需要的可以自行查看
</summary>

#### 部署到 Netlify
Expand Down
Binary file removed docs/images/bing-cookie.png
Binary file not shown.
Binary file modified docs/images/demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0346671

Please sign in to comment.