mirror of
https://github.com/xuthus83/LittlePaimon.git
synced 2024-12-16 13:40:53 +08:00
Merge pull request #406 from Mmx233/Bot
This commit is contained in:
commit
b862431019
43
.github/workflows/release_docker.yaml
vendored
Normal file
43
.github/workflows/release_docker.yaml
vendored
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
name: Release Docker Image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- v**
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup Docker Buildx Command
|
||||||
|
id: buildx
|
||||||
|
uses: docker/setup-buildx-action@master
|
||||||
|
|
||||||
|
- name: Login to docker registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: ${{ secrets.DOCKER_IMAGE_REGISTRY }}
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Get Docker Image Url
|
||||||
|
id: image
|
||||||
|
env:
|
||||||
|
URL: ${{ secrets.DOCKER_IMAGE_REGISTRY }}${{ secrets.DOCKER_IMAGE_PATH }}
|
||||||
|
run: |
|
||||||
|
echo LATEST=${URL}:latest >> $GITHUB_OUTPUT
|
||||||
|
echo VERSION=${URL}:${GITHUB_REF/refs\/tags\//} >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Build Docker Image and Push
|
||||||
|
id: docker_build
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
push: true
|
||||||
|
context: .
|
||||||
|
file: ./dockerfile
|
||||||
|
tags: ${{ steps.image.outputs.VERSION }},${{ steps.image.outputs.LATEST }}
|
26
dockerfile
Normal file
26
dockerfile
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
FROM python:slim
|
||||||
|
|
||||||
|
RUN pip3 --no-cache-dir install nb-cli
|
||||||
|
|
||||||
|
ENV TZ=Asia/Shanghai \
|
||||||
|
DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
RUN ln -fs /usr/share/zoneinfo/${TZ} /etc/localtime && \
|
||||||
|
echo ${TZ} > /etc/timezone && \
|
||||||
|
dpkg-reconfigure --frontend noninteractive tzdata
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y git && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
WORKDIR /data/pkg
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN sed -i 's/^\-\-index\-url\s.*$//' requirements.txt && \
|
||||||
|
pip3 install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
|
RUN playwright install-deps && \
|
||||||
|
playwright install chromium && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
CMD ["nb", "run"]
|
Loading…
x
Reference in New Issue
Block a user