Skip to content

Commit

Permalink
Update ci-app.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacAndra authored Sep 11, 2024
1 parent 86420c2 commit e6e3548
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions .github/workflows/ci-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,27 @@ jobs:
restore-keys: |
${{ runner.os }}-maven-
- name: Build Application JAR
run: mvn clean package

- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}


- name: Build Application JAR
working-directory: ./home/runner/work/blog-api-server
run: mvn clean package

- name: List files
working-directory: ./home/runner/work/blog-api-server
run: ls -R
run: ls -R

- name: Docker Compose Build
working-directory: ./home/runner/work/blog-api-server
run: docker compose build
- name: Build Docker Image
run: docker build -t ${{ secrets.DOCKER_USERNAME }}/blog-api-server .


- name: Push to Docker Hub Container Registry
- name: Tag and Push Docker Image
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
- name: Run Docker Compose
run: docker-compose -f docker-compose.yml up -d

0 comments on commit e6e3548

Please sign in to comment.