Skip to content

Github action to destroy a preview env in Okteto Cloud as part of your automated development workflow

License

Notifications You must be signed in to change notification settings

jLopezbarb/destroy-preview

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Actions for Okteto Cloud

Automate your development workflows using Github Actions and Okteto Cloud

GitHub Actions gives you the flexibility to build an automated software development workflows. With GitHub Actions for Okteto Cloud you can create workflows to build, deploy and update your applications in Okteto Cloud.

Get started today with a free Okteto Cloud account!

Github Action for Deleting a Preview environment in Okteto Cloud

You can use this action to delete a preview environment in Okteto Cloud as part of your automated development workflow.

Inputs

name

Required The name of the Okteto preview environment to delete.

Remember that the preview environment name must have your github ID as a suffix.

Example usage

This example runs the login action and then deletes a preview environment.

# File: .github/workflows/workflow.yml
on: [push]

name: example

jobs:

  devflow:
    runs-on: ubuntu-latest
    steps:
    
    - uses: okteto/login@master
      with:
        token: ${{ secrets.OKTETO_TOKEN }}
    
    - name: "Delete the previews preview environment"
      uses: okteto/destroy-preview@master
      with:
        name: dev-previews-cindylopez

Advanced usage

Custom Certification Authorities or Self-signed certificates

You can specify a custom certificate authority or a self-signed certificate by setting the OKTETO_CA_CERT environment variable. When this variable is set, the action will install the certificate in the container, and then execute the action.

Use this option if you're using a private Certificate Authority or a self-signed certificate in your Okteto Enterprise instance. We recommend that you store the certificate as an encrypted secret, and that you define the environment variable for the entire job, instead of doing it on every step.

# File: .github/workflows/workflow.yml
on: [push]

name: example

jobs:
  devflow:
    runs-on: ubuntu-latest
    env:
      OKTETO_CA_CERT: ${{ secrets.OKTETO_CA_CERT }}
    steps:
    - uses: okteto/login@master
      with:
        token: ${{ secrets.OKTETO_TOKEN }}
   
    - name: "Delete the previews preview environment"
      uses: okteto/destroy-preview@master
      with:
       name: dev-previews-cindylopez

About

Github action to destroy a preview env in Okteto Cloud as part of your automated development workflow

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 79.8%
  • Dockerfile 20.2%