mirror of
https://github.com/PaiGramTeam/FixMiYouShe.git
synced 2024-11-21 23:18:03 +00:00
ci: add Dockerfile
All checks were successful
Docker Build / docker build and publish (push) Successful in 1m14s
All checks were successful
Docker Build / docker build and publish (push) Successful in 1m14s
This commit is contained in:
parent
ea26dddbde
commit
3de12c1de7
50
.gitea/workflows/docker.yml
Normal file
50
.gitea/workflows/docker.yml
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
name: "Docker Build"
|
||||||
|
|
||||||
|
# Controls when the action will run.
|
||||||
|
on:
|
||||||
|
# Triggers the workflow on push or pull request events but only for the master branch
|
||||||
|
workflow_dispatch: ~
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: docker build and publish
|
||||||
|
env:
|
||||||
|
DOCKER_BUILDKIT: 1
|
||||||
|
DOCKER_CLI_EXPERIMENTAL: enabled
|
||||||
|
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
DOCKERHUB_REPOSITORY: ${{ vars.DOCKER_REPO }}
|
||||||
|
DOCKER_TAG: 'latest'
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Login to DockerHub
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_TOKEN }}
|
||||||
|
|
||||||
|
- name: Setup Docker Buildx
|
||||||
|
uses: crazy-max/ghaction-docker-buildx@v3
|
||||||
|
|
||||||
|
- name: Buildx cache
|
||||||
|
uses: actions/cache@v2
|
||||||
|
id: buildx-cache
|
||||||
|
with:
|
||||||
|
path: /tmp/.buildx-cache
|
||||||
|
key: ${{ runner.os }}-buildx
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
docker buildx build \
|
||||||
|
--cache-from "type=local,src=/tmp/.buildx-cache" \
|
||||||
|
--cache-to "type=local,dest=/tmp/.buildx-cache" \
|
||||||
|
--output "type=image,push=true" \
|
||||||
|
--platform "linux/amd64" \
|
||||||
|
--tag "${DOCKERHUB_REPOSITORY}:${DOCKER_TAG}" \
|
||||||
|
-f Dockerfile \
|
||||||
|
.
|
11
Dockerfile
Normal file
11
Dockerfile
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
FROM python:3.12-slim
|
||||||
|
LABEL authors="xtaodada"
|
||||||
|
|
||||||
|
WORKDIR /usr/app
|
||||||
|
|
||||||
|
COPY requirements.txt .
|
||||||
|
RUN /bin/sh -c set -eux; apt-get update; apt-get install -y --no-install-recommends git ; rm -rf /var/lib/apt/lists/* # buildkit
|
||||||
|
RUN pip install -r requirements.txt
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
CMD [ "python", "main.py" ]
|
@ -11,6 +11,6 @@ aiofiles==23.2.1
|
|||||||
jinja2==3.1.3
|
jinja2==3.1.3
|
||||||
beautifulsoup4
|
beautifulsoup4
|
||||||
lxml
|
lxml
|
||||||
tgcrypto
|
PyroTgCrypto==1.2.6a0
|
||||||
pyrogram
|
git+https://github.com/TeamPGM/pyrogram
|
||||||
urlextract
|
urlextract
|
||||||
|
Loading…
Reference in New Issue
Block a user