GuidesAPI Reference
Log In
Guides

Github Actions

Prodvana supports Github Actions through two Actions:

Getting Started

  1. Create a Prodvana API token and add it to your Github Repository as an Github Action Secret named PRODVANA_API_TOKEN.
  2. You're now ready to use the Prodvana orb! See Examples below for usage examples.

Examples

Push Service with Parameters

This example pushes a Service with two parameters, image and replicas:

<...>

steps:
  # example docker image build
  - uses: docker/build-push-action@v2
    with:
      push: ${{ inputs.push }}
      tags: ${{ env.REGISTRY }}/myservice:${{ github.sha }}
  # pvnctl must be installed in your Action environment for push-to-prodvana
  - uses: prodvana/[email protected] 
    with:
      org: my-org
      api_token: ${{ secrets.PRODVANA_API_TOKEN }}
  - uses: prodvana/[email protected]
    with:
      app: my-application
      service: my-service
      parameters: image=${{ env.REGISTRY }}/myservice:${{ github.sha }},replicas=2
      wait_channels: staging # wait for the staging release channel to complete before considering this complete

Push Service with One Image

<...>

steps:
  # example docker image build
  - uses: docker/build-push-action@v2
    with:
      push: ${{ inputs.push }}
      tags: ${{ env.REGISTRY }}/myservice:${{ github.sha }}
  # pvnctl must be installed in your Action environment for push-to-prodvana
  - uses: prodvana/[email protected] 
    with:
      org: my-org
      api_token: ${{ secrets.PRODVANA_API_TOKEN }}
  - uses: prodvana/[email protected]
    with:
      app: my-application
      service: my-service
      docker_image: ${{ env.REGISTRY }}/myservice:${{ github.sha }}
      wait_channels: staging # wait for the staging release channel to complete before considering this complete

Push Service with Multiple Programs

If you have a Service with multiple programs, you can pass docker-image a comma separated list of program_name=image_url; e.g, <program_name_1>=<image_url_1>,<program_name_2>=<image_url_2>,....

<...>

steps:
  # example docker image build
  - uses: docker/build-push-action@v2
    with:
      push: true
      tags: ${{ env.REGISTRY }}/myservice:${{ github.sha }}
  - uses: docker/build-push-action@v2
    with:
      push: true
      context: api_sidecar
      tags: ${{ env.REGISTRY }}/myservice:${{ github.sha }}
  # pvnctl must be installed in your Action environment for push-to-prodvana
  - uses: prodvana/[email protected] 
    with:
      org: my-org
      api_token: ${{ secrets.PRODVANA_API_TOKEN }}
  - uses: prodvana/[email protected]
    with:
      app: my-application
      service: my-service
       # when passing multiple images, use comma-separated pairs of program=image, e.g.
       # <program_name_1>=<image_url_1>,<program_name_2>=<image_url_2>,...
      docker-image: api=${{ env.REGISTRY }}/myservice:${{ github.sha }},api_sidecar=${{ env.REGISTRY }}/myservice_sidecar:${{ github.sha }}
      wait_channels: staging # wait for the staging release channel to complete before considering this complete