{"id":19320960,"url":"https://github.com/defanglabs/defang-github-action","last_synced_at":"2026-03-07T02:25:58.369Z","repository":{"id":251290985,"uuid":"836463161","full_name":"DefangLabs/defang-github-action","owner":"DefangLabs","description":"A GitHub Action to deploy with Defang.","archived":false,"fork":false,"pushed_at":"2026-03-06T17:32:39.000Z","size":111,"stargazers_count":9,"open_issues_count":7,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-03-06T20:56:49.478Z","etag":null,"topics":["aws","cloud","defang","digitalocean","gcp","github-actions"],"latest_commit_sha":null,"homepage":"https://defang.io/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DefangLabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-07-31T22:56:53.000Z","updated_at":"2026-03-06T17:32:43.000Z","dependencies_parsed_at":"2026-01-08T22:05:57.145Z","dependency_job_id":null,"html_url":"https://github.com/DefangLabs/defang-github-action","commit_stats":null,"previous_names":["defanglabs/defang-github-action"],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/DefangLabs/defang-github-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DefangLabs%2Fdefang-github-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DefangLabs%2Fdefang-github-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DefangLabs%2Fdefang-github-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DefangLabs%2Fdefang-github-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DefangLabs","download_url":"https://codeload.github.com/DefangLabs/defang-github-action/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DefangLabs%2Fdefang-github-action/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30206023,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T19:07:06.838Z","status":"online","status_checked_at":"2026-03-07T02:00:06.765Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["aws","cloud","defang","digitalocean","gcp","github-actions"],"created_at":"2024-11-10T01:34:10.705Z","updated_at":"2026-03-07T02:25:58.314Z","avatar_url":"https://github.com/DefangLabs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Defang GitHub Action\n\nA GitHub Action to deploy with [Defang](https://defang.io/). Use this action to deploy your application with Defang, either to the [Defang Playground](https://docs.defang.io/docs/providers/playground), or to [your own AWS account](https://docs.defang.io/docs/providers/aws).\n\n## Usage\n\nThe simplest usage is to deploy a [Compose-based](https://github.com/compose-spec/compose-spec/blob/main/spec.md) project to the Defang Playground. This is done by adding the following to your GitHub workflow, assuming you have a `compose.yaml` file in the root of your repository.\n\nTo do so, just add a job like the following to your GitHub workflow (note the permissions and the Deploy step):\n\n```yaml\njobs:\n  deploy:\n    runs-on: ubuntu-latest\n    permissions:\n      contents: read\n      id-token: write\n\n    steps:\n    - name: Checkout Repo\n      uses: actions/checkout@v4\n\n    - name: Deploy\n      uses: DefangLabs/defang-github-action@v1.2.1\n```\n\n### Managing Config Values\n\nDefang allows you to [securely manage configuration values](https://docs.defang.io/docs/concepts/configuration). You can store your config using [GitHub Actions Secrets](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions) and then pass them through to the Defang action.\n\nTo publish a secret stored in GitHub to the cloud as a secure config value with defang, you need to do two things:\n\n  1. Use the `env` section of the step to pass the value of the secrets to environment variables that match the names of the config values in your Compose file.\n  2. Specify the names of the environment variables you want to push to the cloud as config values in the `config-env-vars` input, either whitespace delimited or as a YAML literal block scalar (`|`).\n\nThe second step is to make sure that we only publish the secrets you explicitly tell us to. For example, you could have a secret in an env var at the job level, instead of the step level that you might not want to push to the cloud, even if it is in a secure store.\n\n```yaml\njobs:\n  test:\n    # [...]\n    steps:\n      # [...]\n    - name: Deploy\n      uses: DefangLabs/defang-github-action@v1.2.1\n      with:\n        # Note: you need to tell Defang which env vars to push to the cloud as config values here. Only these ones will be pushed up.\n        config-env-vars: |\n          API_KEY\n          DB_CONNECTION_STRING\n      env:\n        API_KEY: ${{ secrets.API_KEY }}\n        DB_CONNECTION_STRING: ${{ secrets.DB_CONNECTION_STRING }}\n```\n\n### Projects in a Subdirectory\n\nIf your Compose file is in a different directory than your project root, you can specify the path to the project in the `cwd` input.\n\n```yaml\njobs:\n  test:\n    # [...]\n    steps:\n      # [...]\n    - name: Deploy\n      uses: DefangLabs/defang-github-action@v1.2.0\n      with:\n        cwd: \"./test\"\n```\n\n### Specifying the CLI Version\n\nIf you want to use a specific version of the Defang CLI, you can specify it using the `cli-version` input.\n\n```yaml\njobs:\n  test:\n    # [...]\n    steps:\n      # [...]\n    - name: Deploy\n      uses: DefangLabs/defang-github-action@v1.2.1\n      with:\n        cli-version: v0.5.38\n```\n\n### Customizing the Defang Command\n\nIf you want to customize the Defang command that is run, you can specify it using the `command` input.\nThis is useful if you want to run a command other than `compose up` or if you want to pass additional arguments to the command.\n\n```yaml\njobs:\n  test:\n    # [...]\n    steps:\n      # [...]\n    - name: Deploy\n      uses: DefangLabs/defang-github-action@v1.2.1\n      with:\n        command: \"compose up --project-name my-project\"\n```\n\n### Full Example\n\nHere is a full example of a GitHub workflow that does everything we've discussed so far:\n\n```yaml\nname: Deploy\n\non:\n  push:\n    branches:\n      - main\n\njobs:\n  test:\n    runs-on: ubuntu-latest\n    permissions:\n      contents: read\n      id-token: write\n\n    steps:\n    - name: Checkout Repo\n      uses: actions/checkout@v4\n\n    - name: Deploy\n      uses: DefangLabs/defang-github-action@v1.2.1\n      with:\n        cli-version: v0.5.43\n        config-env-vars: \"API_KEY DB_CONNECTION_STRING\"\n        cwd: \"./test\"\n        compose-files: \"./docker-compose.yaml\"\n        mode: \"staging\"\n        provider: \"aws\"\n        command: \"compose up\"\n        verbose: true\n      env:\n        API_KEY: ${{ secrets.API_KEY }}\n        DB_CONNECTION_STRING: ${{ secrets.DB_CONNECTION_STRING }}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefanglabs%2Fdefang-github-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdefanglabs%2Fdefang-github-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefanglabs%2Fdefang-github-action/lists"}