Update multi_tenant_deploy.yml #18
This file contains hidden or 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 Cloud Cap Samples Java | |
| on: | |
| push: | |
| branches: [multi_tenant_deploy] | |
| workflow_dispatch: | |
| inputs: | |
| cf_space: | |
| description: 'Specify the Cloud Foundry space to deploy to' | |
| required: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout this repository | |
| uses: actions/checkout@v2 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '18' # Change this to at least version 18 | |
| - name: Install MBT | |
| run: npm install -g mbt | |
| - name: Clone the cloud-cap-samples-java repo | |
| run: git clone --depth 1 --branch main https://github.com/vibhutikumar07/cloud-cap-samples-java.git | |
| - name: Change directory to cloud-cap-samples-java | |
| working-directory: cloud-cap-samples-java | |
| run: pwd # Verifies that we're in the correct directory | |
| - name: Run mbt build | |
| working-directory: cloud-cap-samples-java | |
| run: | | |
| echo "java version" | |
| java --version | |
| mbt build | |
| - name: Deploy to Cloud Foundry | |
| working-directory: cloud-cap-samples-java | |
| run: | | |
| echo "Deploying to ${{ github.event.inputs.cf_space }}......" | |
| # Install cf CLI plugin | |
| cf install-plugin multiapps -f | |
| # Login to Cloud Foundry again to ensure session is active | |
| cf login -a ${{ secrets.CF_API }} -u ${{ secrets.CF_USER }} -p ${{ secrets.CF_PASSWORD }} -o ${{ secrets.CF_ORG }} -s ${{ github.event.inputs.cf_space }} | |
| #cf login -a ${{ secrets.CF_API }} -u ${{ secrets.CF_USER }} -p ${{ secrets.CF_PASSWORD }} -o ${{ secrets.CF_ORG }} -s ${{ secrets.CF_SPACE_RISHI }} | |
| # Deploy the application | |
| echo "Current directory.." | |
| pwd | |
| ls -lrth | |
| echo "Running cf deploy" | |
| cf deploy mta_archives/bookshop-mt_1.0.0.mtar -f |