Skip to content

Commit

Permalink
Update docker-ci.yml;
Browse files Browse the repository at this point in the history
  • Loading branch information
cxOrz committed Aug 29, 2022
1 parent 403a8f5 commit d1a5970
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 11 deletions.
34 changes: 27 additions & 7 deletions .github/workflows/docker-ci.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
name: ci
name: Docker-CI

on:
push:
branches:
- 'main'
release:
types: [published]

jobs:
docker:
name: Push Docker image to multiple registries
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Check out the repo
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
Expand All @@ -21,11 +26,26 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to GitHub Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Docker Metadata action
id: meta
uses: docker/[email protected]
with:
images: |
cxorz/chaoxingsigncli
ghcr.io/${{ github.repository }}
-
name: Build and push
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: cxorz/chaoxingsigncli:latest
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,22 @@ npm start

还有一些事情必需知道:

- 目前任何云函数,都无法完美实现监听,如果要在 UI 端使用监听功能,请部署在服务器,并且在运行接口服务之前,先运行一次 `npm run monitor` 来配置默认信息,填写完成后看到 "监听中" ,即可终止程序,信息已经写入本地。然后就可以运行 `npm run serve` 了。
- 此项目可以运行在 AWS Lambda 和 腾讯云函数上运行(均已测试)。如有需求运行在 Serverless 容器,请务必在运行前确保 env.json 中的 `SERVERLESS``true`
- 如过使用腾讯文字识别,请在 env.json 中配置 secretId 和 secretKey。
- 如使用腾讯云函数,请仔细按云函数文档操作,对代码稍作调整,并配置云函数启动文件 scf_bootstrap 内容为如下命令
- 如果要在服务器使用监听功能,在运行接口服务之前,先运行一次 `npm run monitor` 来配置默认信息,填写完成后看到 "监听中",即可终止程序,信息已经写入本地。然后就可以运行 `npm run serve` 了。
- 如果使用腾讯文字识别来解析二维码,请在 env.json 中配置 secretId 和 secretKey。
- 不建议使用本项目构建的 Docker 镜像,一切均为默认设置,局限性较大。如要求不高,简单签个到,请随意。

<details>
<summary>使用云函数注意事项</summary>

1. 此项目可以运行在 AWS Lambda 和 腾讯云函数上运行(均不支持监听)。如有需求运行在 Serverless 容器,请修改 env.json 中的 `SERVERLESS``true`
2. 如使用腾讯云函数,请仔细按云函数文档操作,对代码稍作调整,并配置云函数启动文件 scf_bootstrap 内容为如下命令
``` bash
#!/bin/bash
/var/lang/node16/bin/node -r ts-node/register src/serve.ts
```

</details>

至此,部署完成,可通过域名或服务器 IP 访问接口的默认路径 `/` ,看到欢迎页面。

### 展示
Expand Down

0 comments on commit d1a5970

Please sign in to comment.