0.0.1 #8
Workflow file for this run
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: Create Release | |
on: | |
release: | |
types: [created] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout the repository | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
# Set up JDK | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 # Specify your JDK version | |
distribution: 'temurin' | |
# Cache Gradle dependencies | |
- name: Cache Gradle Dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle | |
# Build the JAR file | |
- name: Build JAR | |
run: ./gradlew bootJar downloadDigmaAgentExtension downloadOtelAgent | |
# Build Docker Image | |
- name: Build Docker Image | |
run: docker build -t petclinic:${{ github.ref_name }} . | |
# Save Docker Image as Artifact | |
- name: Save Docker Image | |
run: | | |
docker save petclinic:${{ github.ref_name }} > petclinic-${{ github.ref_name }}.tar | |
echo "Docker image saved as petclinic-${{ github.ref_name }}.tar" | |
- name: Upload Docker Image | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./petclinic-${{ github.ref_name }}.tar | |
asset_name: petclinic-${{ github.ref_name }}.tar | |
asset_content_type: application/x-tar |