Demystifying GitHub Actions - Harnessing the power of automation to streamline your development process

VictorSzoltysek 31 views 43 slides Sep 09, 2024
Slide 1
Slide 1 of 52
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52

About This Presentation

Dive into this deck on GitHub Actions, where we blend essential automation tips with fun movie-themed memes! Learn how to optimize your workflows, secure projects, and identify all the film references. Perfect for developers eager to enhance their GitHub skills and add efficiency to their processes....


Slide Content

By: Victor Szoltysek
Aug 30th / 2024
RAVL EIP
Harnessing the power of automation to
streamline your development process
DEMYSTIFYING
GITHUB ACTIONS

GITHUB ACTIONS IS EASY
Essentially a scheduler and runner that's incredibly simple to use.
Free for public repositories on GitHub.
Just add a GitHub Action file to define what to do and when.
Meant to be used by developer (directly).
GitHub Actions: a Developer's Best Friend

When
What

HOW DO I BUILD THIS AGAIN?
Avoid the "works on my machine" syndrome.
Implement from day one—you'll thank me later.
Simplify your current 47-step build process.
Build Consistency: Once and for all

On Code Commit
Checkout
Code
Setup Java
Run Build

WHO BROKE THE BUILD?
Immediate action required if the build fails: fix or roll back.
Temporary red builds are fine; permanent red is not.
Tip: Use Webhooks (MS Teams) to keep everyone informed.
Keeping the Build Green

Custom Action

Easy to create custom
MS Teams Incoming
Webhook (just
copy+paste the URL)

ENHANCING YOUR BUILD PROCESS
As a dev team, add additional checks to ensure quality.
Linting, Code Analysis, Unit Testing etc.
Use the same checks locally and on GitHub Actions.
Automate More, Stress Less

Note - one call (not
multiple)

PRESERVING BUILDS
By default, builds are temporary—learn to save what matters.
Preserve build artifacts for deployment and future
reference.
Ensure the availability and integrity of your artifacts.
Securing Your Build Artifacts

WHAT’S IN THE BUILD?
Eliminate the "Is it deployed yet?" and "What’s in the build?"
confusion — you’re thank me later.
Uniquely version your builds — it’s easy! Don’t make it hard !
Unique filename and runtime check of version including GitHash /
Build Time / and version number.
Know Your Build Inside Out

Gradle (Java) Build Script Snippet
Auto GitHub Environment
Variable

You know exactly
what’s deployed
endpoint

WHERE’S THE DEPLOY BUTTON?
Prevent the scramble for deployment procedures and credentials due to
infrequent use.
Set up automated deployments from Day 1 — You’ll thank me later.
Don’t store secrets/passwords in source control—use GitHub Secrets instead.
You can also add manual gates (approval steps).
Deployment at a Click

MY BUILDS ARE SLOW
Builds slow down as projects grow
Keep core builds under 10 minutes for fast feedback
Profile builds and fix slow steps
Managing Build Performance

MY BUILDS ARE SLOW
The term "Pipeline" is deceptive; it implies sequential steps for DevOps.
Parallelize builds across actions, steps and agents to save time.
Avoiding making multiple sequential calls just to get the pretty pipeline
steps.
Why 'Pipeline' Can Be a Misnomer

MY BUILDS ARE SLOW
Use caching actions to avoid redundant operations.
Treat every build as a release candidate; avoid multiple
identical builds (i.e. 4 instead of 1)
Skip builds for changes that don’t affect the final product.
Reducing Redundancy in Builds

Cache Maven (Java) Dependencies

Skip build on non-code changes

MY BUILDS ARE SLOW
Externalize slow, less critical tests into separate, less frequent
workflows.
Parallize execution (across agents) to reduce bottlenecks.
Handle slow, mandatory checks imposed by other teams in a
separate workflow, using CODEOWNER files to manage access rights.
Separating and Optimizing Slow Steps

Nightly Security Check

.github/OWNERS file — lock access for security check

KEY TAKEAWAYS
Try GitHub Actions on your next GitHub Public repo
Use ChatGPT to write your GitHub Actions scripts
Advocate for fast automated builds, quick feedback, auto deploys, and versioned
artifacts on your teams.
If things are brittle, slow, and manual — automate them and do them more often.
Action To Take

[email protected]
www.victorszoltysek.com

Reusable Workflows: Utilize reusable workflows to avoid duplication and maintain consistent standards across projects. Allow
for custom workflows when specific needs arise to maintain flexibility.
Custom Actions Development: Develop custom actions to automate unique processes tailored to your projects, enhancing
efficiency. Allow standard actions to be used alongside custom ones to avoid reinventing the wheel and opt for battle-tested,
official actions.
Use of CODEOWNERS Files: Implement CODEOWNERS files to secure and manage access to critical code changes.
Specifically, lock down workflow modifications to designated teams like Security or QA, ensuring controlled updates.
Dynamic Status Badges: Incorporate dynamic status badges in project READMEs to instantly show workflow health with a
dash of visual flair—adding some razzle-dazzle to your project's visibility.
Dependency Graphs Over Sequential Pipelines: Design workflows as dependency graphs rather than traditional sequential
pipelines. This approach optimizes execution paths and reduces waiting times by highlighting interdependencies and allowing
for concurrent executions.
Utilization of Built-in Variables: Leverage GitHub’s built-in environment variables for dynamic configuration management
across your workflows, minimizing manual setup and maintenance.
Secure Secrets Management: Use GitHub Secrets to securely manage sensitive information within your workflows, ensuring
that credentials are shielded and compliance is maintained.
Scheduled Workflows: Optimize resource utilization by scheduling non-critical workflows to run during off-peak hours,
reducing load and improving efficiency.
Essential GitHub Actions Insights for Advanced Workflows