Skip to content

Commit

Permalink
Merge pull request #3 from HChenZi/dev
Browse files Browse the repository at this point in the history
ci: 支持docker方式运行
  • Loading branch information
Maojuan-lang authored Sep 12, 2023
2 parents cf3bd46 + d435aed commit e527c86
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 1 deletion.
40 changes: 40 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Docker Hub Release

on:
push:
branches: [main]

jobs:
docker:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Docker
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Generate Tags
uses: docker/metadata-action@v4
id: metadata
with:
images: |
${{ secrets.DOCKERHUB_USERNAME }}/senkongdao
tags: |
type=raw,value=latest
- name: Build and Publish
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile
push: true
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Build Stage
FROM python:3.9 as build
WORKDIR /usr/app
RUN python -m venv /usr/app/venv
ENV PATH="/usr/app/venv/bin:$PATH"

COPY requirements.txt .
RUN pip install -r requirements.txt

# Final Deployment Stage
FROM python:3.9-slim

WORKDIR /app
COPY --from=build /usr/app/venv .
COPY . .

ENV PATH="/app/bin:$PATH"

CMD ["python", "SenKongDao.py"]
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@
>
> 5. 控制台返回的一串长度为32的数字字母组合字符串即为所需Cred字段
>
支持多账号,每行一个账号即可
支持多账号,每行一个账号即可

以下为某个账户的实例:

xxxxxx&yyyyyyyyyy

### 或使用 docker 运行
1. 参考上面教程新建 `SenKongDao_config.txt` 文件,填入 `uid` 以及 `cred` 字段
2. 运行 `docker run -v ./SenKongDao_config.txt:/app/SenKongDao_config.txt cblackorange/senkongdao` 其中 `./SenKongDao_config.txt` 为配置文件路径,可自行修改

0 comments on commit e527c86

Please sign in to comment.