From d3acbe00249fa5599dc0576b411e6277d47b3906 Mon Sep 17 00:00:00 2001 From: gitea_admin Date: Thu, 18 Dec 2025 12:54:44 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.github/workflows/buidl=5F?= =?UTF-8?q?and=5Fpush=5Fghcr.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/buidl_and_push_ghcr.yml | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/buidl_and_push_ghcr.yml b/.github/workflows/buidl_and_push_ghcr.yml index 64907d5..2170477 100644 --- a/.github/workflows/buidl_and_push_ghcr.yml +++ b/.github/workflows/buidl_and_push_ghcr.yml @@ -15,8 +15,22 @@ jobs: runs-on: ubuntu-latest steps: - - name: Debug Docker socket + - name: Checkout code + uses: actions/checkout@v4 + + - name: Extract metadata + id: meta run: | - echo "Looking for Docker socket..." - find /var/run -name "docker.sock" 2>/dev/null || true - ls -la /var/run/user/ 2>/dev/null || true \ No newline at end of file + echo "date=$(date +'%Y%m%d-%H%M%S')" >> $GITHUB_OUTPUT + echo "sha_short=$(echo ${GITHUB_SHA} | cut -c1-7)" >> $GITHUB_OUTPUT + + - name: Build Docker image + run: | + docker build \ + -t myapp:${{ steps.meta.outputs.sha_short }} \ + -t myapp:latest \ + -f Dockerfile \ + . + + - name: List images + run: docker images | grep myapp \ No newline at end of file