{"id":18624740,"url":"https://github.com/opszero/actions-deploytag","last_synced_at":"2025-04-11T04:32:17.642Z","repository":{"id":36397610,"uuid":"198500034","full_name":"opszero/actions-deploytag","owner":"opszero","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-23T22:38:16.000Z","size":1126,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-26T16:21:14.836Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://opszero.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/opszero.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["abhiyerra"],"custom":["https://www.opszero.com"]}},"created_at":"2019-07-23T20:01:36.000Z","updated_at":"2024-10-23T22:38:19.000Z","dependencies_parsed_at":"2024-03-18T21:32:32.669Z","dependency_job_id":"47e0a160-e439-4e74-9ee5-81100474e026","html_url":"https://github.com/opszero/actions-deploytag","commit_stats":{"total_commits":195,"total_committers":7,"mean_commits":"27.857142857142858","dds":0.4769230769230769,"last_synced_commit":"94a29b8d28a03c1175dd17fa2975c4fc81f12abe"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opszero%2Factions-deploytag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opszero%2Factions-deploytag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opszero%2Factions-deploytag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opszero%2Factions-deploytag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opszero","download_url":"https://codeload.github.com/opszero/actions-deploytag/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223458152,"owners_count":17148423,"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":[],"created_at":"2024-11-07T04:30:36.473Z","updated_at":"2024-11-07T04:32:27.405Z","avatar_url":"https://github.com/opszero.png","language":"JavaScript","funding_links":["https://github.com/sponsors/abhiyerra","https://www.opszero.com"],"categories":[],"sub_categories":[],"readme":"# actions-deploytag\n\nDeploy Feature Environments to Kubernetes using Github Actions\n\n\n## Github Actions\n\nFor Github Actions we have the following checklist:\n\n - [ ] OIDC IAM\n - [ ] Build Docker\n - [ ] Push to ECR\n - [ ] Deploy using Helm\n\n### Kubernetes Deployment with Feature Branches\n\nEKS Deployment\n\n```\nname: Deploy\n\non:\n  push:\n    branches:\n      - qa\n      - production\n      - 'feature_deploy/**'\n      - 'bug/**'\n      - 'epic/**'\n\njobs:\n  deploy:\n    name: Test, Build, Deploy\n    runs-on: ubuntu-latest\n    permissions:\n      contents: read\n      id-token: write\n\n    services:\n      postgres:\n        image: postgres:13.3\n        env:\n          POSTGRES_USER: postgres\n          POSTGRES_DB: opszero_test\n          POSTGRES_PASSWORD: \"postgres\"\n        ports:\n        - 5432:5432\n        # Set health checks to wait until postgres has started\n        options: \u003e-\n          --health-cmd pg_isready\n          --health-interval 10s\n          --health-timeout 5s\n          --health-retries 5\n\n      redis:\n        image: redis:5.0\n        ports:\n        - 6379:6379\n        options: --entrypoint redis-server\n\n    steps:\n    - name : \"Deploytag\"\n      uses: opszero/deploytag@v2.2\n      id: deploytag\n      with:\n        github-ref: ${{ github.ref }}\n\n    - name: Checkout\n      uses: actions/checkout@v3\n\n    - name: Install Python\n      uses: actions/setup-python@v2\n      with:\n        python-version: '3.9.5'\n\n    - name: Run Tests\n      env:\n        DATABASE_URL: postgres://postgres:postgres@postgres:5432/opszero_test\n        POSTGRES_USER: postgres\n        POSTGRES_HOST: postgres\n        POSTGRES_DB: opszero_test\n        POSTGRES_PASSWORD: \"postgres\"\n      run: |\n        python -m pip install --upgrade pip setuptools wheel pipenv\n        pipenv install --dev\n        cp .env.test .env\n        pipenv run pytest\n\n    - name: Archive code coverage results\n      uses: actions/upload-artifact@v2\n      with:\n        name: code-coverage-report\n        path: output/test/test_results\n\n    - name: Configure AWS credentials\n      uses: aws-actions/configure-aws-credentials@v1\n      with:\n        role-to-assume: arn:aws:iam::123456123123:role/github-deployer\n        aws-region: us-west-2\n\n    - name: Login to Amazon ECR\n      id: login-ecr\n      uses: aws-actions/amazon-ecr-login@v1\n      if: ${{ steps.deploytag.outputs.is-preview == 'true' || github.ref == 'refs/heads/qa' || github.ref == 'refs/heads/production'}}\n\n    - name: Build, tag, and push image to Amazon ECR\n      id: build-image\n      if: ${{ steps.deploytag.outputs.is-preview == 'true' || github.ref == 'refs/heads/qa' || github.ref == 'refs/heads/production'}}\n      env:\n        ECR_REGISTRY: 12345678910.dkr.ecr.us-west-2.amazonaws.com\n        ECR_REPOSITORY: opszero/opszero\n        IMAGE_TAG: ${{ github.sha }}\n      run: |\n        docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .\n        docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG\n\n    - name: Release Feature\n      if: ${{ steps.deploytag.outputs.is-preview == 'true' }}\n      env:\n        ECR_REGISTRY: 12345678910.dkr.ecr.us-west-2.amazonaws.com\n        ECR_REPOSITORY: opszero/opszero\n        IMAGE_TAG: ${{ github.sha }}\n        CLUSTER_NAME: opszero-qa\n      run: |\n        aws eks update-kubeconfig --name $CLUSTER_NAME\n        helm upgrade --install opszero ./charts/opszero  \\\n        --create-namespace \\\n        --namespace ${{ steps.deploytag.outputs.preview-env-name }} \\\n        -f charts/qa.yaml \\\n        -f charts/feature.yaml \\\n        --set secrets.DEPLOYTAG_BRANCH=\"${{ steps.deploytag.outputs.preview-env-name }}\" \\\n        --set image.tag=$IMAGE_TAG \\\n        --set ingress.host=${{ steps.deploytag.outputs.preview-env-name }}.opszero.com\n\n    - name: Release QA\n      if: ${{ github.ref == 'refs/heads/qa' }}\n      env:\n        ECR_REGISTRY: 12345678910.dkr.ecr.us-west-2.amazonaws.com\n        ECR_REPOSITORY: opszero/opszero\n        IMAGE_TAG: ${{ github.sha }} #Latest tag is used in the chart\n        CLUSTER_NAME: opszero-qa\n      run: |\n        aws eks update-kubeconfig --name $CLUSTER_NAME\n        helm upgrade --install opszero ./charts/opszero  \\\n        --namespace qa \\\n        -f charts/qa.yaml \\\n        --set secrets.DEPLOYTAG_BRANCH=qa \\\n        --set secrets.SECRET_KEY=\"${{ secrets.SECRET_KEY }}\" \\\n        --set image.tag=$IMAGE_TAG \\\n        --set ingress.host=qa.opszero.com\n\n    - name: Release Production\n      if: ${{ github.ref == 'refs/heads/production' }}\n      env:\n        ECR_REGISTRY: 12345678910.dkr.ecr.us-west-2.amazonaws.com\n        ECR_REPOSITORY: opszero/opszero\n        IMAGE_TAG: ${{ github.sha }} #Latest tag is used in the chart\n        CLUSTER_NAME: opszero-prod\n      run: |\n        aws eks update-kubeconfig --name $CLUSTER_NAME\n        helm upgrade --install opszero ./charts/opszero  \\\n        -f charts/production.yaml \\\n        --set secrets.DEPLOYTAG_BRANCH=production \\\n        --set image.tag=$IMAGE_TAG \\\n        --set ingress.host=www.opszero.com\n\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopszero%2Factions-deploytag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopszero%2Factions-deploytag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopszero%2Factions-deploytag/lists"}