From dbac10142ec00dd0c1d5a4ca59469162d6b3444d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?YC=E9=85=B1luyancib?= <2058282593@qq.com> Date: Mon, 2 Jun 2025 10:40:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BA=20.github/workflows/docker.y?= =?UTF-8?q?ml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/docker.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..b32528c --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,33 @@ +name: Docker + +on: + workflow_dispatch: + push: + branches: + - main # default branch + paths: + - bot/**/** + +jobs: + Ghcr: + name: Publish to ghcr.io + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4.2.2 + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3.8.0 + - name: Login + uses: docker/login-action@v3.3.0 + with: + registry: ghcr.io + username: ${{ secrets.GH_USERNAME }} + password: ${{ secrets.GH_TOKEN }} + - name: Build & Push + uses: docker/build-push-action@v6.11.0 + with: + context: . + push: true + tags: ghcr.io/${{github.repository}}:latest + platforms: linux/amd64,linux/arm64 + cache-from: type=registry,ref=ghcr.io/${{github.repository}}:latest + cache-to: type=inline \ No newline at end of file