Skip to content

dictybase-docker/prepare-deploy

Repository files navigation

prepare deploy

All Contributors

License
Continuous integration
Last commit
Funding

The dictybase-docker/prepare-deploy is a Typescript action that triggers a github deployment for the same repository. The action is mainly designed to work with the following assumption..

  • For deploying in cloud hosted (such as gke, azure etc) kubernetes cluster. Defaults to gke.
  • The code will be deployed using helm.
  • The helm chart exists in the same repository.
  • The deployment event generated by this action is expected to be captured by another github workflow to deploy the actual software.

Usage

The action can be run in any of the provided vms, however ubuntu-latest is recommended.

steps:
  - name: prepare for deploy
    uses: dictybase-docker/prepare-deploy@v1
    with:
      cluster-name: staging
      namespace: dictybase
      chart-name: event-manager
      chart-path: deployment/chart/event-email
      image-tag: sha-4839d84a
      ref: 483fjke81 #(or v1.2.3 or feat/hot-fuzz etc.)
      token: ${{ github.token }}

It is recommended to run it after a test and build jobs(CI), for example...

name: Continuous build and prepare deploy
on: 
 push:
   branches:
     - develop
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: check out code
        uses: actions/checkout@v2
      - name: unit test
        run: 'some test command'
  build:
    needs: test
    runs-on: ubuntu-latest
    steps:
      - name: check out code
        uses: actions/checkout@v2
         name: image build and push
        uses: docker/build-push-action@v1
        with:
          username: ${{ secrets.DOCKER_USER }}
          password: ${{ secrets.DOCKER_PASSWORD  }}
          repository: dictybase/auto-deploy
          add_git_labels: true
          tag_with_sha: true
  prepare-deploy:
    needs: build
    runs-on: ubuntu-latest
    steps:
      - name: create deploy event
        uses: dictybase-docker/prepare-deploy@v1
        with:
          cluster-name: staging
          namespace: dictybase
          # rest of it 

Inputs

The following inputs are supported.

  • cluster-name - (required) The name of kubernetes cluster where the code will be deployed.

  • namespace - (required) The name of kubernetes namespace.

  • cluster-zone - (optional) The cloud zone where the cluster is deployed. Defaults to us-central1-a for a gke cluster.

  • chart-name - (required) The name of helm chart to be deployed.

  • chart-path - (required) The chart location path relative to the root of the repository.

  • image-tag - (required) Docker image tag that will be deployed.

  • ref - (required) The name of a specific git branch, sha or tag that will be deployed.

  • token - (required) Github token for authentication.

  • owner - (required) Owner of the GitHub repository. (i.e. dictyBase)

  • repo - (required) Name of the GitHub repository. (i.e. dicty-frontpage)

  • environment - (optional) Runtime environment name. Default to development.

  • artifact - Name of upload artifact containing a file with the deployment payload. It can be accessed with download artifact action within the same workflow. The name defaults to deploy-payload

Outputs

The following outputs are supported.

  • deployment-response - Contain deployment payload in the output which can be accessed in any successive step in the same job.
  • upload-response - Contain upload artifact payload to be accessed in any successive step within the same job.

Misc badges

Issues Open Issues Closed Issues
Total PRS Open PRS Closed PRS Merged PRS
Commits Branches Tags
GitHub repo size GitHub code size in bytes

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Siddhartha Basu

💻 📖 ⚠️ 🚧

Eric Hartline

💻 📖 🚧

This project follows the all-contributors specification. Contributions of any kind welcome!