From 494a62d9846cf2c03fbe95be217b3a323026858f Mon Sep 17 00:00:00 2001 From: Ramachandran Nellaiyappan Date: Sat, 9 Mar 2024 21:25:24 +0100 Subject: [PATCH] [feat] Release workflow updated with packaging and deploy steps --- .github/workflows/prepare-release.yml | 29 ++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index 6c096ed2..86ebd3cd 100644 --- a/.github/workflows/prepare-release.yml +++ b/.github/workflows/prepare-release.yml @@ -6,7 +6,7 @@ # separate terms of service, privacy policy, and support # documentation. -name: Prepare Release +name: Package, Release & Deploy on: workflow_dispatch: @@ -50,3 +50,30 @@ jobs: draft: false prerelease: false + # Publish Docker Image + - name: Log in to Docker Hub + uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: codewithram/journey-api + + - name: Build and push Docker image + uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 + with: + context: . + file: ./Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + - name: Trigger Deployment + env: + deploy_url: ${{ secrets.RENDER_DEPLOY_HOOK_URL }} + run: | + curl "$deploy_url"