Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refact: github workflows #172

Merged
merged 12 commits into from
Dec 5, 2024
Merged

refact: github workflows #172

merged 12 commits into from
Dec 5, 2024

Conversation

crlssn
Copy link
Owner

@crlssn crlssn commented Dec 5, 2024

PR Type

enhancement, configuration changes


Description

  • Removed multiple custom GitHub Actions (apply/terraform, deploy/backend, deploy/web, migrate/database, and validate/terraform) to simplify the repository structure.
  • Refactored the deploy.yml workflow to include all deployment steps inline, consolidating Terraform application, database migration, backend deployment, and web deployment.
  • Improved security by directly using GitHub secrets and variables for sensitive data handling.
  • Enhanced maintainability by reducing reliance on separate action definitions.

Changes walkthrough 📝

Relevant files
Configuration changes
action.yml
Removed Terraform apply GitHub Action definition.               

.github/actions/apply/terraform/action.yml

  • Removed the apply/terraform GitHub Action definition.
  • Action previously handled Terraform setup and application.
  • +0/-41   
    action.yml
    Removed backend deployment GitHub Action definition.         

    .github/actions/deploy/backend/action.yml

  • Removed the deploy/backend GitHub Action definition.
  • Action previously deployed backend to EC2 instances.
  • +0/-107 
    action.yml
    Removed web deployment GitHub Action definition.                 

    .github/actions/deploy/web/action.yml

  • Removed the deploy/web GitHub Action definition.
  • Action previously deployed web app to S3.
  • +0/-59   
    action.yml
    Removed database migration GitHub Action definition.         

    .github/actions/migrate/database/action.yml

  • Removed the migrate/database GitHub Action definition.
  • Action previously handled database migrations.
  • +0/-41   
    action.yml
    Removed Terraform validation GitHub Action definition.     

    .github/actions/validate/terraform/action.yml

  • Removed the validate/terraform GitHub Action definition.
  • Action previously validated Terraform configurations.
  • +0/-34   
    Enhancement
    deploy.yml
    Refactored deployment workflow with consolidated steps.   

    .github/workflows/deploy.yml

  • Refactored the deployment workflow to consolidate Terraform, database,
    server, and web deployment steps.
  • Removed references to previously defined custom actions.
  • Added inline steps for Terraform application, database migration,
    backend deployment, and web deployment.
  • Improved usage of GitHub secrets and variables for sensitive data
    handling.
  • +137/-42

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    Copy link

    github-actions bot commented Dec 5, 2024

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
    🧪 No relevant tests
    🔒 Security concerns

    Sensitive information exposure:
    The PR introduces changes where secrets are used directly in the workflow files. Ensure that all sensitive data handling adheres to security best practices, such as masking outputs and using encrypted secrets.

    ⚡ Recommended focus areas for review

    Hardcoded Values
    The workflow contains hardcoded values for environment variables and paths which could be moved to GitHub secrets or environment variables for better security and flexibility.

    Missing Error Handling
    There is no error handling for steps that might fail, such as Terraform commands or database migrations. Consider adding 'fail-fast' or error-catching mechanisms.

    Security Concerns
    The use of secrets directly in the workflow steps without masking could potentially expose sensitive information in logs. Review and ensure that all sensitive outputs are masked or handled securely.

    Copy link

    github-actions bot commented Dec 5, 2024

    PR Code Suggestions ✨

    No code suggestions found for the PR.

    @crlssn crlssn added the deploy Deploy the branch to production label Dec 5, 2024
    @crlssn crlssn added deploy Deploy the branch to production and removed deploy Deploy the branch to production labels Dec 5, 2024
    Copy link

    codecov bot commented Dec 5, 2024

    Bundle Report

    Bundle size has no change ✅

    @crlssn crlssn added deploy Deploy the branch to production and removed deploy Deploy the branch to production labels Dec 5, 2024
    @crlssn crlssn added deploy Deploy the branch to production and removed deploy Deploy the branch to production labels Dec 5, 2024
    @github-actions github-actions bot removed the deploy Deploy the branch to production label Dec 5, 2024
    @crlssn crlssn merged commit 6dada4f into main Dec 5, 2024
    1 check passed
    @crlssn crlssn deleted the refact/workflows branch December 5, 2024 11:23
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    1 participant