{"id":20821960,"url":"https://github.com/internetarchive/cicd","last_synced_at":"2025-07-08T19:35:19.799Z","repository":{"id":53863738,"uuid":"444595350","full_name":"internetarchive/cicd","owner":"internetarchive","description":"build \u0026 test using github registry; deploy to nomad clusters","archived":false,"fork":false,"pushed_at":"2025-04-17T00:40:54.000Z","size":72,"stargazers_count":17,"open_issues_count":0,"forks_count":0,"subscribers_count":17,"default_branch":"main","last_synced_at":"2025-04-17T13:42:11.384Z","etag":null,"topics":["build","cicd","deploy","docker-images","github-registry","nomad","test"],"latest_commit_sha":null,"homepage":"https://internetarchive.github.io/cicd","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/internetarchive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-01-04T23:37:03.000Z","updated_at":"2025-04-17T00:40:57.000Z","dependencies_parsed_at":"2025-01-18T16:45:54.066Z","dependency_job_id":"e383b74b-8fab-48f3-b3b1-03017885ef76","html_url":"https://github.com/internetarchive/cicd","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/internetarchive/cicd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/internetarchive%2Fcicd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/internetarchive%2Fcicd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/internetarchive%2Fcicd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/internetarchive%2Fcicd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/internetarchive","download_url":"https://codeload.github.com/internetarchive/cicd/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/internetarchive%2Fcicd/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264334478,"owners_count":23592430,"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":["build","cicd","deploy","docker-images","github-registry","nomad","test"],"created_at":"2024-11-17T22:13:34.457Z","updated_at":"2025-07-08T19:35:19.794Z","avatar_url":"https://github.com/internetarchive.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# CI/CD - Continuous Integration \u0026 Deployment\n\nbuild \u0026 test using github registry; deploy to nomad clusters, using\n[GitHub Actions reusable workflows](https://docs.github.com/en/actions/using-workflows/reusing-workflows)\n\n([workflows syntax](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions))\n\n---\n\n# Example usage \u0026 setup\n1. Copy the yaml below into your github repo with a `Dockerfile` - (any name, `cicd.yml`, etc.) in a subdir from the top: `.github/workflows/`:\n\n```yaml\non: [push, workflow_dispatch]\njobs:\n  cicd:\n    uses: internetarchive/cicd/.github/workflows/cicd.yml@main\n```\n\n2. If you want to deploy to a nomad cluster add a `NOMAD_TOKEN` secret:\n\n```yml\non: [push, workflow_dispatch]\njobs:\n  cicd:\n    uses: internetarchive/cicd/.github/workflows/cicd.yml@main\n    secrets:\n      NOMAD_TOKEN: ${{ secrets.NOMAD_TOKEN }}\n```\n\n⭐ **For each repo you use this with**, _add a_ ⭐\n[GitHub Secret](https://docs.github.com/en/actions/security-guides/encrypted-secrets)\nwith name: `NOMAD_TOKEN`, getting the value from a nomad cluster admin (for archive.org: tracey, brenton, robK, etc.)\n\nIf not an archive.org repo, update these two arguments to the nomad cluster wildcard DNS domain and API URL you can add `BASE_DOMAIN` and `NOMAD_ADDR` to your yaml:\n```yaml\non: [push, workflow_dispatch]\njobs:\n  cicd:\n    uses: internetarchive/cicd/.github/workflows/cicd.yml@main\n    with:\n      BASE_DOMAIN: 'example.com'\n      NOMAD_ADDR: 'https://nomad.example.com:4646'\n    secrets:\n      NOMAD_TOKEN: ${{ secrets.NOMAD_TOKEN }}\n```\n\nYou can then find your `Actions` tab in your repo and you should see the build, (optional test), and deploy fire off.\n\nThe logs will show you the webapp URL for your deployed project.\n\n---\n\n## Optional production cluster (archive.org repos only)\nTo deploy to the archive.org \"high availability\" production cluster, you simply need to:\n- Add another\n[GitHub Secret](https://docs.github.com/en/actions/security-guides/encrypted-secrets)\nnamed `NOMAD_TOKEN_PROD`,\ngetting the value from a nomad cluster admin (for archive.org: tracey, robK, brenton etc.)\n- Add this to your yaml (above):\n\n```yaml\non: [push, workflow_dispatch]\njobs:\n  cicd:\n    uses: internetarchive/cicd/.github/workflows/cicd.yml@main\n    secrets:\n      NOMAD_TOKEN_PROD: ${{ secrets.NOMAD_TOKEN_PROD }}\n```\n- push a branch named `production` for your repo\n\n---\n\n## Customize your deploy\nYou can send various `NOMAD_VAR_*` variables into the [deploy] phase, options listed here:\n- [.github/workflows/cicd.yml](.github/workflows/cicd.yml)\n\nYou can see explanations for the various options here:\n- https://github.com/internetarchive/nomad#customizing\n- NOTE: while the snippet examples are gitlab repo-centric, mentally substitute\nthe documentation there which says `variables:` to be `with:` like below example:\n\n```yaml\non: [push, workflow_dispatch]\njobs:\n  cicd:\n    uses: internetarchive/cicd/.github/workflows/cicd.yml@main\n    with:\n      NOMAD_VAR_MEMORY: 1000\n    secrets:\n      NOMAD_TOKEN: ${{ secrets.NOMAD_TOKEN }}\n```\n\n---\n\n## Multi arch builds (eg: for mac ARM)\nIf you want to build for linux/x86 _and_ mac ARM you can add `PLATFORMS`:\n\n```yaml\non: [push, workflow_dispatch]\njobs:\n  cicd:\n    uses: internetarchive/cicd/.github/workflows/cicd.yml@main\n    with:\n      PLATFORMS: 'linux/amd64, linux/arm64'\n```\n\n\n## Want a more custom pipeline?\nYou can setup arbitrary jobs, custom tests, and more.\n\nSee this nice example which splits out the same [build] and [deploy] steps used normally, into explicit jobs, dependent on other test jobs, etc.\n\n- https://github.com/internetarchive/hello-js\n- https://github.com/internetarchive/hello-js/blob/main/.github/workflows/cicd.yml\n\n---\n\n## Interact with / debug your deploy\nYou can see more information on how to `ssh` in to your running deployment, inspect logs, get detailed status information, and even \"hot copy\" updated files into a running deploy (and more) at:\n- https://github.com/internetarchive/nomad#laptop-access\n- https://github.com/internetarchive/nomad#inspect-poke-around\n\n---\n\n## Interesting in linting code?\nCheck out https://github.com/internetarchive/dyno\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finternetarchive%2Fcicd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finternetarchive%2Fcicd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finternetarchive%2Fcicd/lists"}