From 93630a821df6f79945559f3ebb4baebd3ae493fc Mon Sep 17 00:00:00 2001 From: Zhengchen Tao Date: Mon, 6 Apr 2026 14:26:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=9E=84=E5=BB=BA=E5=92=8C?= =?UTF-8?q?=E6=8E=A8=E9=80=81=20Docker=20=E9=95=9C=E5=83=8F=E7=9A=84=20Git?= =?UTF-8?q?Hub=20Actions=20=E5=B7=A5=E4=BD=9C=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-and-deploy.yml | 36 ++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/build-and-deploy.yml diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml new file mode 100644 index 00000000..0ca4e167 --- /dev/null +++ b/.github/workflows/build-and-deploy.yml @@ -0,0 +1,36 @@ +name: Build and Push Docker Image + +on: + push: + branches: + - myrequirement + +jobs: + build-and-push: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout + uses: actions/checkout@v5 + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: ghcr.io/${{ github.repository }}:latest + cache-from: type=gha + cache-to: type=gha,mode=max