Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
livecycle

GitHub Action

Preevy Down

v1.2.0

Preevy Down

livecycle

Preevy Down

Runs the Preevy `down` command

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Preevy Down

uses: livecycle/[email protected]

Learn more about this action in livecycle/preevy-down-action

Choose a version

Deploy preview environment using preevy

About Preevy

Preevy is a powerful CLI tool designed to simplify the process of creating ephemeral preview environments. Using Preevy, you can easily provision any Docker Compose application using any Kubernetes server or affordable VMs on AWS Lightsail, Google Cloud or Azure VM.

Visit The full documentation here: https://preevy.dev/

About the preevy-down action

Use this action to delete a preview environment using the Preevy CLI whenever a PR is merged or closed. More information about running Preevy from CI over here.

Preevy's GitHub plugin will automatically update the comment generated by the "up" workflow to indicate the environment was deleted.

See the preevy-up action for more information and examples.

Inputs

profile-url

required: true

The profile url created by the CLI, as detailed in the docs.

docker-compose-yaml-paths

required: false

Optional path to the docker-compose.yaml file. If not provided, uses the working directory. If you have multiple docker compose files, you can add them as a comma seperated string like so 'docker-compose.yml,docker-compose.dev.yml'

args

required: false

Optional additional args to the preevy down command, see the full reference here.

version

required: false

The preevy CLI version to use. Defaults to latest.

Note Version v1.2.0 of this action supports Preevy CLI versions 0.0.58 and up. To use an older version of the CLI, use livecycle/[email protected].

node-cache

required: false

Node package manager used for caching. Supported values: npm, yarn, pnpm, or ''. Details. Default: npm.

Example usage

name: Teardown Preevy environment
on:
  pull_request:
    types:
      - closed
permissions:
  id-token: write
  contents: read

  # needed to update the PR comment with the environment URLs
  pull-requests: write
jobs:
  teardown:
    runs-on: ubuntu-latest
    steps:
      - uses: aws-actions/configure-aws-credentials@v2
        with:
          role-to-assume: arn:aws:iam::12345678:role/my-role
          aws-region: eu-west-1

      - uses: actions/checkout@v3
      - uses: livecycle/[email protected]
        id: preevy
        with:
          # Create the profile using the `preevy init` command, see
          # https://preevy.dev/ci/overview
          profile-url: "s3://preevy-12345678-my-profile?region=eu-west-1"
          docker-compose-yaml-paths: "./docker/docker-compose.yaml"