Skip to content

comsysto/deployment-information-action

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deployment Information Action

A GitHub JavaScript action to create, read and parse deployment information provided as JSON file.

Structure

The repository is separated into two actions:

Both actions uses the same JSON structure.

Example usage

name: Couldfoundry CI Lab
on: [push]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - name: Set up JDK 11
      uses: actions/setup-java@v1
      with:
        java-version: 11
    - name: Build with Gradle
      run: ./gradlew clean build
    - name: Copy manifest.yaml
      run: cp ./manifest.yaml <archive-path>
    - name: Retrieve artifact information from gradle
      id: artifact-information
      run: |
        archivesBaseName="$(./gradlew properties -q | grep '^archivesBaseName:' | awk '{print $2}')"
        version="$(./gradlew properties  -q | grep '^version:' | awk '{print $2}')"

        echo "::set-output name=artifact-base-name::${archivesBaseName}"
        echo "::set-output name=artifact-version::${version}"
    - name: Create deployment information
      uses: comsysto/deployment-information-action/[email protected]
      with:
        artifact-base-name: ${{ steps.artifact-information.outputs.artifact-base-name }}
        artifact-version: ${{ steps.artifact-information.outputs.artifact-version }}
        archive-name: <archive-name>
        target-path: <archive-path>
    - name: Upload deploymentArchive
      uses: actions/upload-artifact@v1
      with:
        name: <archive-name>
        path: <archive-path>
  deploy:
    runs-on: ubuntu-latest
    needs: build
    steps:
      - name: Download artifact
        uses: actions/download-artifact@v1
        with:
          name: <archive-name>
      - name: Read deploymentInfo.json
        id: deploymentInfo
        uses: comsysto/deployment-information-action/[email protected]
        with:
          archive-path: <archive-name>
      - name: cf push
        uses: comsysto/cloudfoundry-action/[email protected]
        with:
          args: push -f ${{ steps.deploymentInfo.outputs.cf-manifest-path }} -p ${{ steps.deploymentInfo.outputs.artifact-path }} --no-start

In case of building an artifact using Gradle the <archive-path> could be build/libs.

Projects that uses the the Deployment Information action

Sources: