Merge pull request #27 from isaacmaffeis/split_project #34
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Push CI Pipeline | |
on: | |
push: | |
branches: | |
- '**' | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
name: Build and Test with Maven | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Build with Maven | |
run: mvn --batch-mode clean install | |
- name: Upload Artifact codegen | |
if: github.ref == 'refs/heads/main' || github.event.pull_request.base.ref == 'main' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: asmetal2java_codegen-0.0.1-SNAPSHOT-jar-with-dependencies.jar | |
path: asmetal2java_codegen/target/asmetal2java_codegen-0.0.1-SNAPSHOT-jar-with-dependencies.jar | |
retention-days: 1 | |
- name: Upload Artifact asmgen | |
if: github.ref == 'refs/heads/main' || github.event.pull_request.base.ref == 'main' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: asmetal2java_asmgen-0.0.1-SNAPSHOT-jar-with-dependencies.jar | |
path: asmetal2java_asmgen/target/asmetal2java_asmgen-0.0.1-SNAPSHOT-jar-with-dependencies.jar | |
retention-days: 1 | |
docker: | |
name: Push Docker Image | |
needs: build | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' || github.event.pull_request.base.ref == 'main' | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Download artifact codegen | |
uses: actions/download-artifact@v4 | |
with: | |
name: asmetal2java_codegen-0.0.1-SNAPSHOT-jar-with-dependencies.jar | |
path: ./asmetal2java_codegen/target | |
- name: Download artifact asmgen | |
uses: actions/download-artifact@v4 | |
with: | |
name: asmetal2java_asmgen-0.0.1-SNAPSHOT-jar-with-dependencies.jar | |
path: ./asmetal2java_asmgen/target | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build and push codegen | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./asmetal2java_codegen | |
dockerfile: ./asmetal2java_codegen/Dockerfile | |
push: true | |
tags: isaacmaffeis/asmetal2java_codegen:latest | |
- name: Build and push asmgen | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./asmetal2java_asmgen | |
dockerfile: ./asmetal2java_asmgen/Dockerfile | |
push: true | |
tags: isaacmaffeis/asmetal2java_asmgen:latest | |
- name: Delete Artifacts | |
uses: GeekyEggo/delete-artifact@v5.1.0 | |
with: | |
name: | | |
asmetal2java_codegen-0.0.1-SNAPSHOT-jar-with-dependencies.jar | |
asmetal2java_asmgen-0.0.1-SNAPSHOT-jar-with-dependencies.jar |