Skip to content

Merge pull request #13 from IsaacAndra/dev #24

Merge pull request #13 from IsaacAndra/dev

Merge pull request #13 from IsaacAndra/dev #24

Workflow file for this run

name: CI App PipeLine
on:
push:
branches: [ "prod" ]
jobs:
app:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Cache Maven dependencies
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-maven-${{ hashFiles('pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build Application JAR
run: mvn clean package
- name: List files
run: ls -R
- name: Docker Compose Build
run: docker compose build
- name: Push to Docker Hub Container Registry
run: |
docker tag ${{ secrets.DOCKER_USERNAME }}/blog-api-server:latest ${{ secrets.DOCKER_USERNAME }}/blog-api-server:${{ github.run_id }}
docker push ${{ secrets.DOCKER_USERNAME }}/blog-api-server:${{ github.run_id }}
docker push ${{ secrets.DOCKER_USERNAME }}/blog-api-server:latest