diff --git a/.github/workflows/dev_pipeline.yml b/.github/workflows/dev_pipeline.yml new file mode 100644 index 000000000..c2bff5f8d --- /dev/null +++ b/.github/workflows/dev_pipeline.yml @@ -0,0 +1,54 @@ +name: Development pipeline +on: + push: + branches: + kubify + pull_request: + branches: + main + release: + types: + published +jobs: + build: + name: Build spring boot application and package jars + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v2 + with: + java-version: '11' + distribution: 'adopt' + - run: mvn -B package --file pom.xml + - run: mvn --batch-mode --update-snapshots verify + - run: mkdir staging && cp target/*.jar staging + - uses: actions/upload-artifact@v2 + with: + name: application-jars + path: staging + package: + name: Build Docker image and push to GitHub Packages + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + steps: + - name: Check out the repo + uses: actions/checkout@v2 + - name: Retrieve jars + uses: actions/download-artifact@v2 + with: + name: application-jars + - name: Log in to GitHub Docker Registry + uses: docker/login-action@v1 + with: + registry: docker.pkg.github.com + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build the Docker image + uses: docker/build-push-action@v2 + with: + push: true + tags: | + docker.pkg.github.com/${{ github.repository }}/spring-petclinic-image:${{ github.sha }} + docker.pkg.github.com/${{ github.repository }}/spring-petclinic-image:${{ github.ref }} \ No newline at end of file diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml deleted file mode 100644 index 38800ae78..000000000 --- a/.github/workflows/maven.yml +++ /dev/null @@ -1,32 +0,0 @@ -# This workflow will build a Java project with Maven -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven - -name: Java CI with Maven - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 11 - uses: actions/setup-java@v2 - with: - java-version: '11' - distribution: 'adopt' - - name: Build with Maven - run: mvn -B package --file pom.xml - - package: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Build the Docker image - run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) \ No newline at end of file diff --git a/docker_build.sh b/docker_build.sh deleted file mode 100644 index e69de29bb..000000000