Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
vladi14 committed Nov 11, 2023
1 parent b5dbb9b commit b20f779
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions .github/workflows/ci_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,35 +27,44 @@ jobs:
version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
next_version=$(echo $version | awk -F'[.-]' '{print $1"."$2"."$3+1}')
mvn versions:set -DnewVersion=$next_version
echo "release_version=$next_version" >> "$GITHUB_OUTPUT"
echo $nextVersion >> version.txt
- name: Compile Code and Package Artifact
working-directory: ./myapp
run: |
mvn clean package
- name: Create Artifact Item
- name: Create Jar artifact
uses: actions/upload-artifact@v3
with:
name: my-artifact
path: ${{ github.workspace }}/myapp/target/*.jar

- name: Create Version artifact
uses: actions/upload-artifact@v2
with:
name: version
path: myapp/version.txt


publish:
runs-on: ubuntu-latest
needs: build
steps:
- name: Use Variable
run: echo ${{needs.job1.outputs.output1}} ${{needs.job1.outputs.output2}}

- name: Checkout Code
uses: actions/checkout@v4

- uses: actions/download-artifact@master
- name: Download JAR
uses: actions/download-artifact@v3
with:
name: my-artifact
path: ${{ github.workspace }}/myapp/target/

- name: Download Version
uses: actions/download-artifact@v3
with:
name: version

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

Expand All @@ -67,15 +76,19 @@ jobs:
with:
username: ${{ secrets.DOCKER_UNAME }}
password: ${{ secrets.DOCKER_KEY }}


- name: Set tag version
run : |
echo "new_tag=$(cat version.txt)"
- name: Build Docker image and push
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile
push: true
tags: vladipiko/maven-hello-world:latest

tags: vladipiko/maven-hello-world:${{ env.newVersion}}

deploy:
runs-on: ubuntu-latest
Expand Down

0 comments on commit b20f779

Please sign in to comment.