From 9a75cd5d8f3dd66c2f79b8ac7dc80ae4524b8147 Mon Sep 17 00:00:00 2001 From: omg-xtao <100690902+omg-xtao@users.noreply.github.com> Date: Sat, 9 Sep 2023 13:54:00 +0000 Subject: [PATCH] Update Dockerfile --- .github/workflows/miboogram.yml | 56 +++++++++++++++++++ .github/workflows/paigram.yml | 56 +++++++++++++++++++ .github/workflows/{docker.yml => pamgram.yml} | 6 +- 3 files changed, 115 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/miboogram.yml create mode 100644 .github/workflows/paigram.yml rename .github/workflows/{docker.yml => pamgram.yml} (88%) diff --git a/.github/workflows/miboogram.yml b/.github/workflows/miboogram.yml new file mode 100644 index 0000000..28219e1 --- /dev/null +++ b/.github/workflows/miboogram.yml @@ -0,0 +1,56 @@ +name: "MibooGram 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: + inputs: + tags: + description: 'main version tag, example: v4' + required: true + default: 'v4' + +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_MIBOOGRAM_REPO }} + DOCKER_TAG: ${{ github.event.inputs.tags }} + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Login to DockerHub + uses: docker/login-action@v1 + 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: Download Dockerfile + run: | + wget -O Dockerfile https://raw.githubusercontent.com/PaiGramTeam/MibooGram/zzz/Dockerfile + + - 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,linux/arm64/v8" \ + --tag "${DOCKERHUB_REPOSITORY}:${DOCKER_TAG}" \ + -f Dockerfile \ + . diff --git a/.github/workflows/paigram.yml b/.github/workflows/paigram.yml new file mode 100644 index 0000000..8b96836 --- /dev/null +++ b/.github/workflows/paigram.yml @@ -0,0 +1,56 @@ +name: "PaiGram 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: + inputs: + tags: + description: 'main version tag, example: v4' + required: true + default: 'v4' + +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_PAIGRAM_REPO }} + DOCKER_TAG: ${{ github.event.inputs.tags }} + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Login to DockerHub + uses: docker/login-action@v1 + 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: Download Dockerfile + run: | + wget -O Dockerfile https://raw.githubusercontent.com/PaiGramTeam/PaiGram/main/Dockerfile + + - 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,linux/arm64/v8" \ + --tag "${DOCKERHUB_REPOSITORY}:${DOCKER_TAG}" \ + -f Dockerfile \ + . diff --git a/.github/workflows/docker.yml b/.github/workflows/pamgram.yml similarity index 88% rename from .github/workflows/docker.yml rename to .github/workflows/pamgram.yml index 9c64409..f069640 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/pamgram.yml @@ -1,4 +1,4 @@ -name: "Docker Build" +name: "PamGram Docker Build" # Controls when the action will run. on: @@ -18,7 +18,7 @@ jobs: DOCKER_BUILDKIT: 1 DOCKER_CLI_EXPERIMENTAL: enabled DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKERHUB_REPOSITORY: ${{ secrets.DOCKER_REPO }} + DOCKERHUB_REPOSITORY: ${{ vars.DOCKER_PAMGRAM_REPO }} DOCKER_TAG: ${{ github.event.inputs.tags }} steps: - name: Checkout @@ -42,7 +42,7 @@ jobs: - name: Download Dockerfile run: | - wget -O Dockerfile https://raw.githubusercontent.com/luoshuijs/TGPaimonBot/main/Dockerfile + wget -O Dockerfile https://raw.githubusercontent.com/PaiGramTeam/PamGram/sr/Dockerfile - name: Build run: |