From 6cd1567295106e2584773f9629bafb89417fe579 Mon Sep 17 00:00:00 2001 From: kaynetik Date: Mon, 7 Oct 2024 12:58:22 +0200 Subject: [PATCH] squash --- .github/workflows/release.yml | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c5fbe6c..c450ad6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,8 +8,12 @@ permissions: contents: write packages: write +# env: +# REGISTRY_IMAGE: ghcr.io/${{ github.repository }}/seda-data-proxy + env: - REGISTRY_IMAGE: ghcr.io/${{ github.repository }}/seda-data-proxy + REGISTRY: ghcr.io + IMAGE_NAME: sedaprotocol/seda-data-proxy jobs: build-and-push: @@ -19,31 +23,36 @@ jobs: - name: 📥 Checkout code uses: actions/checkout@v4 - - name: 🏷️ Docker meta + - name: 🏷️ Extract metadata (tags, labels) for Docker id: meta uses: docker/metadata-action@v5 with: - images: ${{ env.REGISTRY_IMAGE }} + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=edge,branch=main - name: 🛠️ Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: 🔐 Login to GitHub Container Registry + - name: 🔐 Log in to the Container registry uses: docker/login-action@v3 with: - registry: ghcr.io + registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: 🏗️ Build and Push Docker Image + - name: 🏗️ Build and push Docker image uses: docker/build-push-action@v5 with: context: . push: true - tags: | - ${{ env.REGISTRY_IMAGE }}:${{ github.ref_name }} - ${{ env.REGISTRY_IMAGE }}:latest + tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max create-release: name: 📦 Create GitHub Release