Skip to content

CD Pipeline to Render #1

CD Pipeline to Render

CD Pipeline to Render #1

Workflow file for this run

# This workflow will build a Java project with Maven, build the Docker images of
# the microservices # and push them to GitHubContainer Registry.
name: Java CI/CD
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Build the MoneyTransfer microservice Docker image
run: docker build ./moneytransfer --file ./moneytransfer/Dockerfile --tag ghcr.io/${{ github.repository_owner }}/money-transfer-app:latest
- name: Build the Notifications microservice Docker image
run: docker build ./notifications --file ./notifications/Dockerfile --tag ghcr.io/${{ github.repository_owner }}/notifications-app:latest
- name: List Docker images
run: docker images
- name: Log in to GitHub Container Registry
run: echo "${{ secrets.PAT }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Push MoneyTransfer microservice Docker image to GitHub Container Registry
run: docker push ghcr.io/${{ github.repository_owner }}/money-transfer-app:latest
- name: Push Notifications microservice Docker image to GitHub Container Registry
run: docker push ghcr.io/${{ github.repository_owner }}/notifications-app:latest
- name: Deploy
uses: johnbeynon/render-deploy-action@v0.0.8
with:
service-id: ${{ secrets.MY_RENDER_SERVICE_ID }}
api-key: ${{ secrets.MY_RENDER_API_KEY }}
wait-for-success: true