{"id":24393584,"url":"https://github.com/sv222/go-cicd-examples","last_synced_at":"2026-04-16T05:34:45.938Z","repository":{"id":135305490,"uuid":"606516140","full_name":"sv222/go-cicd-examples","owner":"sv222","description":"This repository contains examples of CI/CD workflows for a Go application using GitHub Actions.","archived":false,"fork":false,"pushed_at":"2023-02-25T23:00:03.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-30T12:42:06.419Z","etag":null,"topics":["ci-cd","devops","examples","github-actions","go","samples"],"latest_commit_sha":null,"homepage":"","language":"YAML","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/sv222.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-02-25T18:16:01.000Z","updated_at":"2025-04-28T07:17:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"71d7266a-b473-4771-98f6-d7616188b914","html_url":"https://github.com/sv222/go-cicd-examples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sv222/go-cicd-examples","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sv222%2Fgo-cicd-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sv222%2Fgo-cicd-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sv222%2Fgo-cicd-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sv222%2Fgo-cicd-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sv222","download_url":"https://codeload.github.com/sv222/go-cicd-examples/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sv222%2Fgo-cicd-examples/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31872665,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"online","status_checked_at":"2026-04-16T02:00:06.042Z","response_time":69,"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":["ci-cd","devops","examples","github-actions","go","samples"],"created_at":"2025-01-19T18:40:42.700Z","updated_at":"2026-04-16T05:34:45.915Z","avatar_url":"https://github.com/sv222.png","language":"YAML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CI/CD Workflows for Go Application using GitHub Actions\n\nThis repository contains three examples of CI/CD workflows for a Go application using GitHub Actions. Each workflow performs a set of steps, such as testing, linting, building, and deploying the application. You can choose the workflow that suits your requirements and modify it as per your needs.\n\n## Workflow 1: Simple CI/CD Workflow with Go Test and Docker\n\nThis workflow performs the following steps:\n\n1. Checks out the latest code from the `main` branch\n2. Builds the Docker image of the Go application\n3. Runs Go tests using `go test`\n4. If the tests pass, pushes the Docker image to a Docker registry.\n\nHere is the GitHub Actions workflow file:\n\n```yaml\nname: CI/CD Workflow\n\non:\n  push:\n    branches: [main]\n\njobs:\n  build-and-test:\n    runs-on: ubuntu-latest\n\n    steps:\n    - name: Checkout code\n      uses: actions/checkout@v2\n\n    - name: Setup Go environment\n      uses: actions/setup-go@v2\n      with:\n        go-version: '1.20'\n\n    - name: Build and test\n      run: |\n        docker build -t my-go-app .\n        go test ./...\n\n    - name: Publish Docker image\n      if: success()\n      uses: docker/build-push-action@v2\n      with:\n        context: .\n        push: true\n        tags: my-go-app:latest\n```\n\n## Workflow 2: Advanced CI/CD Workflow with Code Coverage and Deployment\n\nThis workflow performs the following steps:\n\n1. Checks out the latest code from the main branch.\n2. Sets up the Go environment and installs dependencies\n3. Runs Go tests with code coverage using go test\n4. Uploads code coverage results to Codecov\n5. Builds and pushes the Docker image to a Docker registry\n6. Deploys the Docker image to a Kubernetes cluster using Helm\n\nHere is the GitHub Actions workflow file:\n\n```yaml\nname: CI/CD Workflow\n\non:\n  push:\n    branches: [main]\n\njobs:\n  test-and-deploy:\n    runs-on: ubuntu-latest\n\n    steps:\n    - name: Checkout code\n      uses: actions/checkout@v2\n\n    - name: Setup Go environment\n      uses: actions/setup-go@v2\n      with:\n        go-version: '1.20'\n\n    - name: Install dependencies\n      run: go mod download\n\n    - name: Run tests with coverage\n      run: |\n        go test -v -race -coverprofile=coverage.out ./...\n        go tool cover -html=coverage.out -o coverage.html\n\n    - name: Upload code coverage to Codecov\n      uses: codecov/codecov-action@v2\n      with:\n        token: ${{ secrets.CODECOV_TOKEN }}\n\n    - name: Build and push Docker image\n      uses: docker/build-push-action@v2\n      with:\n        context: .\n        push: true\n        tags: my-go-app:latest\n\n    - name: Deploy to Kubernetes with Helm\n      uses: azure/k8s-deploy@v1\n      with:\n        method: helm\n        helm-version: '3.2.4'\n        namespace: my-go-app\n        chart: ./helm/my-go-app\n        set: image.tag=latest\n        kubeconfig: ${{ secrets.KUBECONFIG }}\n```\n\nNote: The second workflow assumes that you are using Codecov for code coverage and Kubernetes with Helm for deployment. You will need to provide the necessary values for CODECOV_TOKEN and KUBECONFIG secrets in your repository.\n\nWorkflow 3: CI/CD Workflow with Linting and Integration Tests\nThis workflow performs the following steps:\n\nChecks out the latest code from the main branch\nRuns Go linter using golangci-lint\nBuilds and runs integration tests on the Go application\nIf the tests pass, builds and pushes the Docker image to a Docker registry.\nHere is the GitHub Actions workflow file:\n\n```yaml\nname: CI/CD Workflow\n\non:\n  push:\n    branches: [main]\n\njobs:\n  build-and-test:\n    runs-on: ubuntu-latest\n\n    steps:\n    - name: Checkout code\n      uses: actions/checkout@v2\n\n    - name: Setup Go environment\n      uses: actions/setup-go@v2\n      with:\n        go-version: '1.20'\n\n    - name: Lint code\n      uses: golangci/golangci-lint-action@v2\n      with:\n        args: ['run', '--enable-all']\n\n    - name: Build and test\n      run: |\n        go build -o my-go-app .\n        go test ./integration_tests/...\n\n    - name: Publish Docker image\n      if: success()\n      uses: docker/build-push-action@v2\n      with:\n        context: .\n        push: true\n        tags: my-go-app:latest\n```\n\nNote: In this example, we are using golangci-lint for linting and integration_tests directory for integration tests. You can modify the linting and testing steps based on your requirements. Also, ensure that you have a Dockerfile in the root directory of your Go application.\n\n## Contributing\n\nFeel free to contribute to this project by submitting pull requests or reporting issues.\n\n## License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsv222%2Fgo-cicd-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsv222%2Fgo-cicd-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsv222%2Fgo-cicd-examples/lists"}