Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Automating CI/CD with Github Actions and AWS

Derek Bingham
September 20, 2022

Automating CI/CD with Github Actions and AWS

Derek Bingham

September 20, 2022
Tweet

More Decks by Derek Bingham

Other Decks in Technology

Transcript

  1. © 2022, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Automating CI/CD on AWS with GitHub Actions Derek Bingham (he / him) Developer Advocate Amazon Web services DEVOPS TALKS CONFERENCE 2022
  2. © 2022, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 2 Speaker.Who() ; Derek Bingham 20 + Years as a Software Developer Specialising in Cloud Native Applications 4+ Years at AWS Originally from Ireland, now living in Australia
  3. © 2022, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. The ‘Joy’ of infrequent releases 3
  4. © 2022, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Introduce Automation 4 Merge, test and release code more frequently
  5. © 2022, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. Automate everything ? 5 1. Code Merge 2. Lint Code 3. Build/compile code 4. Run tests 5. Provision architecture 6. Run Security and compliance checks 7. Deployment – either immediately or after approval 8. Testing
  6. © 2022, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. We need choices 6
  7. © 2022, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. Today’s Automation Challenge 7 Flask app running in a container We need to deploy to the AWS cloud Deploy regular releases Using our preferred orchestrator GitHub Actions Deployment mechanism needs to be flexible
  8. © 2022, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Meet the services 8 There are lots you CAN use – but these are what I have chosen
  9. © 2022, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 9 Container Registry Amazon ECR A place to store container images, every time we want to build and deploy code
  10. © 2022, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 10 Orchestration Operationalizes the effort to run, manage, and scale containerized workloads AWS Fargate
  11. © 2022, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 11 Infra as Code • Use the expressive power of a higher- level programming language rather than json, yaml, or a proprietary format • Use programming idioms like parameters, conditionals, loops, composition, and inheritance to model your system • Unit test this code using common test frameworks AWS CDK
  12. © 2022, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 12 GitHub Actions Implement complex orchestration and CI/CD functionality in GitHub by initiating a workflow on any GitHub event
  13. © 2022, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 13 Anatomy of an Action
  14. © 2022, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Demo 14
  15. © 2022, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. Automate 15
  16. © 2022, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 16
  17. © 2022, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Demo 17
  18. © 2022, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. That’s good but … 18
  19. © 2022, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 19 Build AWS CodeBuild • I want to create tasks that run inside AWS • I don’t want to run my tests in GitHub • I want to reduce my security blast radius • I want to be flexible.
  20. © 2022, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 20
  21. © 2022, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Demo 21
  22. © 2022, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 22 Key Takeaways Automation IS everything Embrace the choices and challenges it creates AWS and GitHub Actions can solve many of these challenges Don’t assume there is only ONE way ever again Go Build
  23. © 2022, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Thank you! Derek Bingham Senior Developer Advocate AWS DEVOPS TALKS CONFERENCE 2022