Skip to main content

Customizing your Github Workflow

It is possible to customize your Github workflow file after it is written to the repository. Porter offers several Github actions that allow you to customize your Github actions workflows to accommodate different workflows:

  • Update a Porter deployment -- this action runs a full update sequence (build, push, deploy) for a specific application on Porter.
  • Run a Porter job -- this action runs a job on Porter and waits for it to complete. This is most useful for running database migrations before deployment.
  • Run any CLI command -- this action allows you to run any CLI command, so that you can compose your own workflows.

Full documentation for writing Github actions files can be found here.


Database Migrations and Jobs

When you set up a one-time job to deploy from a Github repository, the job will not run automatically -- the Github action will simply update the image used to run the job.

To get the Github action to run the job automatically, you can use this Github action. For example:

# ... the rest of your Github action
- name: Run Porter job
uses: porter-dev/porter-run-job-action@v0.1.0
job: <job-name> # TODO: replace w/ name of your job
cluster: <cluster-id> # TODO: replace w/ cluster ID
project: <project-id> # TODO: replace w/ project ID
token: ${{ secrets.PORTER_TOKEN_12 }}