Skip to content

Commit

Permalink
improve docker metadata build (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
hgiasac authored Apr 14, 2024
1 parent 5a7116c commit cc73098
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
tags:
- "*"

env:
DOCKER_REGISTRY: ghcr.io
DOCKER_IMAGE_NAME: hasura/ndc-rest

jobs:
tests:
uses: ./.github/workflows/test.yaml
Expand All @@ -24,7 +28,7 @@ jobs:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ghcr.io/hasura
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -34,11 +38,18 @@ jobs:
echo "tagged_version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
shell: bash

- name: Extract metadata (tags, labels) for Docker
id: docker-metadata
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}

- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
tags: ghcr.io/hasura/ndc-rest:${{ steps.get-version.outputs.tagged_version }}
tags: ${{ steps.docker-metadata.outputs.tags }}
labels: ${{ steps.docker-metadata.outputs.labels }}

- name: Build connector definition
run: |
Expand Down

0 comments on commit cc73098

Please sign in to comment.