Versions Compared

Key

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

This guide is intended for partners and customers who want to use their own Github GitHub as their Git repository and CI/CD tool instead of GitLab.

Before you start, make sure you have sufficient rights in GithubGitHub.

  1. Select the right Github repository.GitHub repository.

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

...

  1. Navigate to Actions

...

  1. and click the New Workflow button.

...

    ...

    1. You can use the link

    ...

    1. Set up a workflow yourself.

    ...

      ...

      1. This link creates a file in

      ...

      1. the .github/worflows/

      ...

      1. folder. Use the standard naming github-ci.yml and add the below content to the file.

      ...

      Code Block
      name: Deploy
       
      on:
        push:
          branches: 
            - main
         env:   URL: "https://qa.pricefx.com"- qa
            
        PARTITION: "sandbox-qa"workflow_dispatch: # enable manual runs, useful for dev and uat
              
      jobsenv:
        deploy:
          name: DeployPFX_USER: ${{ vars.PFX_USER }}
        PFX_PASS: ${{ secrets.PFX_PASS }}
      
      jobs:
        test:
          runs-on: ubuntu-latest
          container: maven:3.6-jdk-11
            
          steps:
            - name: Checkout coderepository
              uses: actions/checkout@v2
      checkout@v4
      
            - name: Cache local Maven repository
              uses: Deploy actions/cache@v4
              with:
       pfxpackage         #env:path: /root/.m2/repository
                #PFX_USER: should be set as masked variable in project's settings on Github -> Settings -> CI/CD -> Variable [TODO: modify this as per Github @udayvala] 
       key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
                restore-keys: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
                  
            - name: test
              run: mvn clean test -e --batch-mode
      
        deploy:
          runs-on: ubuntu-latest
          container: pricefx/pfxpackage
          needs: test # only deploy if test results are green 
      
          steps:
            - name: Checkout repository
              uses: actions/checkout@v4
      
            - name: deploy PROD customer
              #PFX_PASS: the same applies to PFX_PASS do not ever put it hereif: github.ref == 'refs/heads/main'
              run: pfxpackage -import -timeout 120 
                -url run:
      https://customer.pricefx.com -partition customer 
              docker run --rm -v $(pwd):$(pwd) -w $(pwd) pricefx/pfxpackageuser $PFX_USER -password $PFX_PASS 
                -from $GITHUB_WORKSPACE $OPTIONS
      
            - name: deploy QA customer-qa
              if: github.ref == 'refs/heads/qa'
              run: pfxpackage -import -timeout 120 
                -url $URL https://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’