Skip to content

docker hub push

docker hub push #36

name: docker hub push
on:
workflow_run:
workflows:
- "sonarqube_test" # The name of the triggering workflowss
types:
- completed
jobs:
docker_hub_images:
runs-on: ubuntu-latest
steps:
- run: echo "This will Build, execute and push the Docker images into Docker repo ji"
- name: Checkout
uses: actions/[email protected]
- name: This will install Java JDK 11 and Maven.
run: |
sudo apt update
sudo apt install openjdk-11-jdk -y
sudo apt install maven -y
- name: This will give version of packages which have install
run: |
java -version
mvn -version
- name: This will execute and run the packages.
run: mvn clean package
- name: Docker Login
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWD }}
- name: Docker Metadata action
id: meta
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175
with:
images: erdipu/java_app
- name: Build and push Docker images
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}