From fe24d4fad9d335e771bc70f89ddb77304f6b044e Mon Sep 17 00:00:00 2001 From: meng Date: Fri, 15 Mar 2024 11:09:33 +0800 Subject: [PATCH] 4234 --- .github/workflows/docker-image.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 5e579c1..14cd401 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -34,17 +34,19 @@ jobs: registry: git.des8.com username: ${{ secrets.HUB_USERNAME }} password: ${{ secrets.HUB_PASSWORD }} - - - name: Get Meta - id: meta - run: | - echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT - echo REPO_VERSION=$(echo ${{ github.ref }} | awk -F"/" '{print $3}' | awk -F"v" '{print $2}') >> $GITHUB_OUTPUT + - name: Checkout uses: actions/checkout@v3 with: github-server-url: http://git.des8.com repository: ${{ secrets.HUB_USERNAME }}/webman-docker + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ${{ secrets.HUB_USERNAME }}/webman-docker + - name: Build and push # https://github.com/docker/build-push-action uses: build-push-action@v4 @@ -59,3 +61,4 @@ jobs: tags: | ${{ secrets.HUB_USERNAME }}/webman-docker:${{ env.PHP_CLI_VERSION }} ${{ secrets.HUB_USERNAME }}/webman-docker:${{ env.PHP_CLI_VERSION }}${{ github.ref_type == 'tag' && format('-{0}', github.ref_name) || '' }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file