mirror of
https://github.com/EstrellaXD/Auto_Bangumi.git
synced 2026-02-12 23:07:05 +08:00
77 lines
1.9 KiB
YAML
77 lines
1.9 KiB
YAML
name: Deploy To Dockerhub(dev)
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- '\d+\.\d+\.\d+-beta\d+'
|
|
- '\d+\.\d+-beta\d+'
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Set up Python 3.11
|
|
uses: actions/setup-python@v3
|
|
with:
|
|
python-version: "3.11"
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
|
pip install pytest
|
|
- name: Test
|
|
working-directory: ./src
|
|
run: |
|
|
pytest
|
|
|
|
dev-latest:
|
|
runs-on: ubuntu-latest
|
|
needs: [test]
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
- name: Create Version info
|
|
working-directory: ./src
|
|
run: |
|
|
echo "VERSION = '$GITHUB_REF_NAME'" > module/__version__.py
|
|
-
|
|
name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v2
|
|
-
|
|
name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
-
|
|
name: Login to Docker Hub
|
|
uses: docker/login-action@v2
|
|
with:
|
|
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
|
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
|
-
|
|
name: Build and push
|
|
uses: docker/build-push-action@v3
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: |
|
|
estrellaxd/auto_bangumi:dev-latest
|
|
estrellaxd/auto_bangumi:${{ github.ref_name }}
|
|
file: Dockerfile
|
|
|
|
generate_release:
|
|
runs-on: ubuntu-latest
|
|
needs: [test]
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
- name: Generate Release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
tag_name: ${{ github.ref_name }}
|
|
release_name: 🌙${{ github.ref_name }}
|
|
draft: true
|
|
prerelease: true
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
|
|
|