Deploying from a Github Repo
Customizing your Github Workflow
It is possible to customize your Github workflow file after it is written to the repository. Porter offers a Github actions step that allow you to customize your Github actions workflows to accommodate different workflows:
- 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.
Examples
Updating the Image Tag of an Application
If you’ve deployed an application from an existing Docker registry, you can update the image tag of an application in your CI/CD file using the Porter CLI.
You can use this Github action. For example:
# ... the rest of your Github action
steps:
- name: Checkout code
uses: actions/checkout@v2.3.4
- name: Set Github tag
id: vars
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Update a Porter application
timeout-minutes: 20
uses: porter-dev/porter-cli-action@v0.1.0
with:
command: app update-tag APP_NAME --tag ${{ steps.vars.outputs.sha_short }}
env:
PORTER_HOST: https://dashboard.getporter.dev
PORTER_CLUSTER: 1234
PORTER_PROJECT: 4321
PORTER_TOKEN: ${{ secrets.PORTER_TOKEN }}