Merge pull request #199 from Darkatse/master

使用 GitHub Actions 自动构建并推送 Docker 镜像
This commit is contained in:
Womsxd 2022-08-20 23:19:28 +08:00 committed by GitHub
commit a62623c78c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 54 additions and 0 deletions

48
.github/workflows/docker-buildx.yml vendored Normal file
View File

@ -0,0 +1,48 @@
name: Buildx Docker image
on:
push:
branches:
- 'master'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: false
default: 'warning'
jobs:
buildx:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Get current date
id: date
run: echo "::set-output name=today::$(date +'%Y-%m-%d')"
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/arm/v6
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/mihoyo-bbs:latest
${{ secrets.DOCKERHUB_USERNAME }}/mihoyo-bbs:${{ steps.date.outputs.today }}

View File

@ -89,6 +89,12 @@ docker-compose logs -f
每次运行Docker容器后容器内将自动按照参数执行签到活动签到完成后容器将默认在每天上午9:30运行一次如果想自行修改时间可自行编辑`docker-compose.yml`文件中的`CRON_SIGNIN`,将其修改成想运行的时间。
若想要更新容器镜像,可以参考以下命令
```text
docker-compose stop
docker-compose pull && docker-compose up -d
```
## 使用python运行(screen)
1. 将本项目Clone至本地后安装好依赖直接运行`python3 server.py`