From 8d399f10e77d6dc10d462ae5e8dd9e5e7c860b09 Mon Sep 17 00:00:00 2001 From: Alexey Vasiliev Date: Sat, 6 Jul 2024 11:09:14 +0300 Subject: [PATCH] build --- .github/workflows/build-and-release.yml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 4531422..52c324d 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -2,10 +2,15 @@ name: "Build and Release" on: push +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + permissions: - contents: write - id-token: write + contents: read packages: write + attestations: write + id-token: write env: GO_VERSION: 1.22.1 @@ -32,12 +37,20 @@ jobs: - name: Login to Docker Hub uses: docker/login-action@v3 with: - registry: ghcr.io + registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + - name: Build and push uses: docker/build-push-action@v6 with: + context: . push: true - tags: le0pard/postal_server:latest + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}