|
| 1 | +# DevOps Common |
| 2 | + |
| 3 | +This repository contains common DevOps resources shared across Minitap projects - for instance, to store reusable GitHub Actions. |
| 4 | + |
| 5 | +## Available GitHub Actions |
| 6 | + |
| 7 | +### Setup Go with Private Repositories |
| 8 | + |
| 9 | +This action configures a Go environment and sets up Git to allow fetching private Go modules from the `minitap-ai` GitHub organization. |
| 10 | + |
| 11 | +#### Usage |
| 12 | + |
| 13 | +```yaml |
| 14 | +- uses: minitap-ai/devops-common/.github/actions/setup-go-private@v1 |
| 15 | + with: |
| 16 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 17 | +``` |
| 18 | +
|
| 19 | +#### Inputs |
| 20 | +
|
| 21 | +- `github-token` (required): A GitHub Personal Access Token (PAT) with access to the private repositories. |
| 22 | + |
| 23 | +--- |
| 24 | + |
| 25 | +### GCP Docker Build and Push |
| 26 | + |
| 27 | +This action builds a Docker image and pushes it to the Google Cloud Platform (GCP) Artifact Registry. It automatically tags the image based on the Git reference: |
| 28 | +- **Tags (e.g., `v1.2.3`):** The image is tagged with the version number. |
| 29 | +- **`development` branch:** The image is tagged as `latest`. |
| 30 | + |
| 31 | +#### Usage |
| 32 | + |
| 33 | +```yaml |
| 34 | +- uses: minitap-ai/devops-common/.github/actions/gcp-docker-build-push@v1 |
| 35 | + with: |
| 36 | + gcp-credentials: ${{ secrets.GCP_SA_KEY }} |
| 37 | + gcp-project-id: ${{ vars.GCP_PROJECT_ID }} |
| 38 | + gcp-region: ${{ vars.GCP_REGION }} |
| 39 | + gcp-artifact-repo: ${{ vars.GCP_ARTIFACT_REPO }} |
| 40 | + github-token: ${{ secrets.GH_PAT }} |
| 41 | + image-name: ${{ vars.IMAGE_NAME }} |
| 42 | +``` |
| 43 | + |
| 44 | +#### Inputs |
| 45 | + |
| 46 | +- `gcp-credentials` (required): The JSON key for a GCP Service Account with permissions to push to the Artifact Registry. Store this as a secret (e.g., `GCP_SA_KEY`). |
| 47 | +- `gcp-project-id` (required): The ID of the GCP project. It is recommended to store this as a repository variable (e.g., `GCP_PROJECT_ID`). |
| 48 | +- `gcp-region` (required): The GCP region where the Artifact Registry is located (e.g., `us-central1`). It is recommended to store this as a repository variable (e.g., `GCP_REGION`). |
| 49 | +- `gcp-artifact-repo` (required): The name of the GCP Artifact Registry repository. It is recommended to store this as a repository variable (e.g., `GCP_ARTIFACT_REPO`). |
| 50 | +- `github-token` (required): A GitHub Personal Access Token (PAT) used to access private Go modules during the Docker build. Store this as a secret (e.g., `GH_PAT`). |
| 51 | +- `image-name` (required): The name of the Docker image to be built and pushed. It is recommended to store this as a repository variable (e.g., `IMAGE_NAME`). |
0 commit comments