# GitHub Actions

## Bump the image tag of components

This action can help bump the image tag for components, including:
- [Billing reporter](https://github.com/tidbcloud/billing-reporter)
- [SLI reporter](https://github.com/tidbcloud/sli-reporter)
- [Clusterproxy](https://github.com/tidbcloud/clusterproxy)

**It is recommended to add a Github Action to the component repo to trigger this action**. Here is [an example](https://github.com/tidbcloud/sli-reporter/blob/master/.github/workflows/release.yaml) in SLI reporter's repo.

**You can also manually trigger the GitHub Action**:
- Go to [here](https://github.com/tidbcloud/infra-cd/actions/workflows/bump-image-tag.yml) 
- Click `Run workflow`
-  Fill the form
- Click `Run workflow` button 

Then a PR will be created automatically to make the change, just review and merge it.

## Set the secret config of Pulumi

If you want to set some sensitive data, such as database passwords or service tokens, you should set them as Pulumi secrets for security.

You can manually trigger this action: 
- Go to [here](https://github.com/tidbcloud/infra-cd/actions/workflows/set-secret-config.yml)
- Click `Run workflow`
- Fill the form
- Click `Run workflow` button

Then a PR will be created, just review and merge it. (Note: some config items may be reordered, it's ok)

## Bump the version of Infra API

This action will be triggered automatically in these situations:

1. When a PR is merged to the main branch in `infra api` repo: the version will be the commit id, and `projects/infra-api/Pulumi.dev.yaml` will be updated.
2. When a tag is pushed in `infra api` repo, the version will be the tag name, and `projects/infra-api/Pulumi.staging.yaml` and `projects/infra-api/Pulumi.prod.yaml` will be updated.

**You can also manually trigger the GitHub Action**:
- Go to [here](https://github.com/tidbcloud/infra-cd/actions/workflows/bump-version.yml) 
- Click `Run workflow`
-  Fill the form (only the `version` field is required)
- Click `Run workflow` button 

Then a PR will be created automatically to make the change, just review and merge it.

![](./imgs/bump-the-version.png)

