mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-04-24 19:32:48 +00:00
Second caller, all on pull-requests
This commit is contained in:
parent
767fcab03c
commit
55816bd1e6
2 changed files with 46 additions and 77 deletions
85
.github/workflows/caller-1.yml
vendored
85
.github/workflows/caller-1.yml
vendored
|
@ -1,8 +1,12 @@
|
|||
name: Caller-1
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- .github/workflows/reusable-1.yml
|
||||
- .github/workflows/caller-1.yml
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
call-reusable-workflow-1-in-local-repo:
|
||||
|
@ -31,77 +35,4 @@ jobs:
|
|||
with:
|
||||
greeting: 'Hi there'
|
||||
name: 'GitHub Actions User'
|
||||
playing-with-docker-jfrog:
|
||||
name: Docker Build and Publish
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup JFrog CLI
|
||||
uses: jfrog/setup-jfrog-cli@v4
|
||||
env:
|
||||
JF_URL: ${{ vars.ARTIFACTORY_URL }}
|
||||
JF_ACCESS_TOKEN: ${{ secrets.JFROG_ACCESS_TOKEN }}
|
||||
|
||||
- name: Build Tag and push Docker Image
|
||||
env:
|
||||
IMAGE_NAME: triala5wxv6.jfrog.io/test-docker/jfrog-docker-example-image:${{ github.run_number }}
|
||||
run: |
|
||||
jf docker build -t $IMAGE_NAME .
|
||||
jf docker push $IMAGE_NAME
|
||||
|
||||
- name: Publish Build info With JFrog CLI
|
||||
env:
|
||||
# Generated and maintained by GitHub
|
||||
JFROG_CLI_BUILD_NAME: jfrog-docker-build-example
|
||||
# JFrog organization secret
|
||||
JFROG_CLI_BUILD_NUMBER : ${{ github.run_number }}
|
||||
run: |
|
||||
# Export the build name and build nuber
|
||||
# Collect environment variables for the build
|
||||
jf rt build-collect-env
|
||||
# Collect VCS details from git and add them to the build
|
||||
jf rt build-add-git
|
||||
# Publish build info
|
||||
jf rt build-publish
|
||||
|
||||
playing-with-artifact-jfrog:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
java: [ '17' ]
|
||||
|
||||
steps:
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
name: Checkout code
|
||||
|
||||
- name: Set up JDK ${{matrix.java}}
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: ${{matrix.java}}
|
||||
distribution: 'temurin'
|
||||
cache: maven
|
||||
|
||||
- name: Add executable permissions
|
||||
run: chmod a+x mvnw
|
||||
|
||||
- name: Maven install dependencies
|
||||
run: ./mvnw clean package
|
||||
|
||||
|
||||
- name: Configure JFrog CLI with Access Token
|
||||
run: |
|
||||
jfrog rt config --url=$JFROG_URL \
|
||||
--access-token=$JFROG_ACCESS_TOKEN \
|
||||
--interactive=false
|
||||
env:
|
||||
JFROG_URL: ${{ secrets.ARTIFACTORY_URL }}
|
||||
JFROG_ACCESS_TOKEN: ${{ secrets.JFROG_ACCESS_TOKEN }}
|
||||
|
||||
- name: Upload Artifact
|
||||
run: |
|
||||
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
|
||||
jfrog rt u "target/*.jar" "my-repo-local/my-app/${VERSION}/"
|
||||
|
||||
|
38
.github/workflows/caller-2.yml
vendored
Normal file
38
.github/workflows/caller-2.yml
vendored
Normal file
|
@ -0,0 +1,38 @@
|
|||
name: Caller-2
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- .github/workflows/reusable-1.yml
|
||||
- .github/workflows/caller-2.yml
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
call-reusable-workflow-1-in-local-repo:
|
||||
uses: ./.github/workflows/reusable-1.yml
|
||||
with:
|
||||
config-path: '.github/labeler.yml' # Provide the required input
|
||||
secrets:
|
||||
token: ${{ secrets.GITHUB_TOKEN }} # Provide the required secret
|
||||
|
||||
second-caller:
|
||||
uses: Piasecki-grid/test-workflows/.github/workflows/reusable-2.yml@main
|
||||
with:
|
||||
config-path: '.github/labeler.yml' # Provide the required input
|
||||
secrets:
|
||||
token: ${{ secrets.GITHUB_TOKEN }} # Provide the required secret
|
||||
|
||||
run-composite-action:
|
||||
runs-on: ubuntu-latest
|
||||
needs: second-caller # Optional: make it run after the reusable workflow
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Use Composite Action
|
||||
uses: Piasecki-grid/test-workflows/actions/my-composite@main
|
||||
with:
|
||||
greeting: 'Hi there'
|
||||
name: 'GitHub Actions User'
|
||||
|
Loading…
Reference in a new issue