Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Select the right GitHub repository.

  2. Navigate to Settings > Security > Secrets and Variables > Actions and configure PFX_PASS secret and PFX_USER variable.

...

  1. Navigate to Actions and click the New Workflow button.

...

  1. You can use the link Set up a workflow yourself.

...

  1. This link creates a file in the .github/worflows/ folder. Use the standard naming github-ci.yml and add the below content to the file.

...

Code Block
name: Deploy
on:
  push:
    branches: 
      - main
      - qa
      
  workflow_dispatch: # enable manual runs, useful for dev and uat
        
env:
  PFX_USER: ${{ vars.PFX_USER }}
  PFX_PASS: ${{ secrets.PFX_PASS }}

jobs:
  deploytest:
    runs-on: ubuntu-latest
    container: pricefx/pfxpackagemaven:3.6-jdk-11
     steps: 
     - namesteps:
Checks-out your repository under $GITHUB_WORKSPACE, so your- jobname: canCheckout accessrepository
it         uses: actions/checkout@v4

      - name: PRODCache -local DeploysMaven yourrepository
logic and other artifacts to the partition using pfxpackage docker imageuses: actions/cache@v4
        ifwith:
github.ref == 'refs/heads/main'         env:path: /root/.m2/repository
          URLkey: 'https://customer.pricefx.com'
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
         PARTITION restore-keys: 'customer'
   ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
      PFX_USER: ${{ vars.PFX_USER }}   
      - PFX_PASSname: ${{ secrets.PFX_PASS }}test
        run: pfxpackagemvn clean test -importe -timeout-batch-mode
120
  deploy:
    runs-on: ubuntu-latest
  -url $URL -user $PFX_USER -password $PFX_PASS -partition $PARTITION 
        container: pricefx/pfxpackage
    needs: test # only deploy if test results are green 

 -from $GITHUB_WORKSPACE $OPTIONS steps:
      - name: QA - Deploys your logic and other artifacts to the partition using pfxpackage docker image Checkout repository
        uses: actions/checkout@v4

      - name: deploy PROD customer
        if: github.ref == 'refs/heads/qamain'
        envrun: pfxpackage -import -timeout 120 
       URL: '   -url https://customer-qa.pricefx.com' -partition customer 
           PARTITION: 'customer-qa'-user $PFX_USER -password $PFX_PASS 
          -from PFX_USER: ${{ vars.PFX_USER }}
    $GITHUB_WORKSPACE $OPTIONS

      - name: deploy QA customer-qa
     PFX_PASS: ${{ secrets.PFX_PASS }}   if: github.ref == 'refs/heads/qa'
        run: pfxpackage -import -timeout 120 
          -url $URLhttps://customer-qa.pricefx.com -partition customer-qa
          -user $PFX_USER -password $PFX_PASS -partition $PARTITION 
          -from $GITHUB_WORKSPACE $OPTIONS

  1. Navigate to Actions > All workflows and you should be able to see the list of workflows and the corresponding workflow runs.

...

GitHub Actions will always download the latest pricefx/pfxpackage docker image from the registry

...

Info

Pro tip: Studio plugin for IntelliJ Idea can generate the .github-ci.yml file for you based on your config.json file, just right-click your project folder then navigate to Pricefx > CI Deployment > Create ‘github-ci.yml’