{"id":20284055,"url":"https://github.com/ccao-data/actions","last_synced_at":"2025-03-04T03:41:48.183Z","repository":{"id":206299223,"uuid":"716212172","full_name":"ccao-data/actions","owner":"ccao-data","description":"GitHub Actions for CCAO Data projects","archived":false,"fork":false,"pushed_at":"2024-05-22T17:15:35.000Z","size":40,"stargazers_count":0,"open_issues_count":10,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-05-22T17:58:50.070Z","etag":null,"topics":["ci","gh-actions","github-actions","infrastructure"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ccao-data.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-08T17:02:57.000Z","updated_at":"2024-05-29T23:35:50.957Z","dependencies_parsed_at":"2023-12-22T01:01:32.054Z","dependency_job_id":"37bee73d-8a5c-40d4-9f09-6ddc720fbc7e","html_url":"https://github.com/ccao-data/actions","commit_stats":null,"previous_names":["ccao-data/actions"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccao-data%2Factions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccao-data%2Factions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccao-data%2Factions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccao-data%2Factions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ccao-data","download_url":"https://codeload.github.com/ccao-data/actions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241780472,"owners_count":20019058,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ci","gh-actions","github-actions","infrastructure"],"created_at":"2024-11-14T14:18:10.344Z","updated_at":"2025-03-04T03:41:48.163Z","avatar_url":"https://github.com/ccao-data.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Actions\n\nGitHub Actions for CCAO Data projects.\n\nThis repo also includes reusable workflows (stored in the `.github/workflows/`\ndirectory) and bash scripts to support them (stored in the\n`.github/workflow/scripts/` directory.)\n\n# Quick links\n\n* [Actions](#actions)\n  * [`setup-terraform`](#setup-terraform)\n  * [`cleanup-terraform`](#cleanup-terraform)\n* [Workflows](#workflows)\n  * [`build-and-run-batch-job`](#build-and-run-batch-job)\n\n# Actions\n\nThe following composite actions are available for use:\n\n## setup-terraform\n\nInstall and configure Terraform and AWS for the correct workspace (staging or\nprod).\n\n### Requirements\n\n* At least one Terraform (`*.tf`) config file must exist in the repo. The path\n  to these files can be specified with the `working-directory` input variable\n  (defaults to `\".\"`).\n* The calling workflow must grant the following permissions to the job that\n  calls this action:\n    * `contents: read`\n    * `id-token: write`\n* Various required inputs and secrets must be passed in by the calling workflow.\n  See the [action file](./setup-terraform/action.yaml) for details.\n\n### Sample usage\n\nSee the `Setup Terraform` step in the `run` job in the\n[build-and-run-batch-job](./.github/workflows/build-and-run-batch-job.yaml)\nworkflow.\n\n## cleanup-terraform\n\nDelete all AWS resources managed by a Terraform configuration.\n\n### Requirements\n\nSee the requirements for [`setup-terraform`](#setup-terraform).\n\n### Sample usage\n\nSee the sample usage for [`setup-terraform`](#setup-terraform).\n\n# Workflows\n\nThe following reusable workflows are available for use:\n\n## build-and-run-batch-job\n\nBuild a Docker image, push it to the GitHub Container Registry, and then\noptionally use that container image to run a job on AWS Batch.\n\nThe Batch job will only run when the workflow is manually dispatched from the\nGitHub UI. Jobs are gated behind an environment called `deploy`, which can\nbe configured to require approval before running. This is handy for intensive\njobs that don't need to be run on every commit during development.\n\nAn optional cleanup step will run on the `pull_request.closed` event if the\ncalling workflow is configured to run on that event as well. This step will\ndelete all AWS resources provisioned by Terraform. No other steps will run\non `pull_request.closed`.\n\nThe workflow is composed of three jobs:\n\n* `build`: Always runs, except on the `pull_request.closed` event. Builds a\n  Docker image and pushes it to GHCR.\n* `run`: Runs after `build` only when manually dispatched and when the\n  `deploy` environment is approved. Provisions a Batch compute\n  environment, job queue, and job definition using the image built in the\n  `build` step using Terraform, and then kicks off a job using that job\n  definition. Waits for the job to complete before exiting.\n* `cleanup`: Deletes all AWS resources created by the workflow. Only runs on\n  the `pull_request.closed` event, in which case neither `build` nor `run`\n  will run.\n\n### Requirements\n\n* A Dockerfile must be defined in the root of the repo whose workflow is\n  calling `build-and-run-batch-job`.\n* An environment called `deploy` must be configured in the calling repo. This\n  environment can be used to gate the `run` job behind approval.\n* If you would like the `cleanup` step to run, the calling workflow must be\n  configured to run on the `pull_request.closed` event.\n* Various AWS VPC and IAM resources that are used across jobs are assumed to\n  already exist. These resources are defined as `data` entities in the Terraform\n  config for the workflow. In the future we could factor this out to make\n  these resource IDs configurable, but for now they are hardcoded to point to\n  the corresponding resources in the CCAO Data AWS organization. See the\n  [Terraform\n  config](./github/workflows/build-and-run-batch-job-terraform/main.tf)\n  for details.\n* The calling workflow must grant the following permissions to the job\n  that calls this workflow:\n    * `contents: read`\n    * `id-token: write`\n    * `packages: write`\n* Various required inputs and secrets must be passed in by the calling workflow.\n  See the [workflow file](./workflows/build-and-run-batch-job/deploy.yaml) for details.\n\n### Sample usage\n\nSee the `build-and-run-model` workflow in\n[model-res-avm](https://github.com/ccao-data/model-res-avm/blob/master/.github/workflows/build-and-run-model.yaml).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fccao-data%2Factions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fccao-data%2Factions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fccao-data%2Factions/lists"}