Docker Build and Push #64
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Docker Build and Push | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| workflow_dispatch: # 手动触发 | |
| schedule: | |
| - cron: '0 0 * * *' # 每天 UTC 时间 00:00 (北京时间 08:00) 运行 | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: 'recursive' # 确保子模块也被检出 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v2 | |
| with: | |
| username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
| password: ${{ secrets.DOCKER_HUB_TOKEN }} | |
| - name: Build and push | |
| run: | | |
| docker build -t uniapi:latest . | |
| docker tag uniapi:latest ryoshi541/uniapi:latest | |
| docker push ryoshi541/uniapi:latest |