How GitHub Actions 10x my productivity

Поділитися
Вставка
  • Опубліковано 30 вер 2024
  • Learn how to use GitHub actions continuous integration and delivery in a software development project. In this quick tutorial, we look at 7 powerful ways to automate code with CI/CD.
    #programming #automation
    - My GitHub Actions in SvelteFire github.com/cod...
    - GitHub Actions Docs github.com/fea...
    - act cli github.com/nek...

КОМЕНТАРІ • 276

  • @StefanoV827
    @StefanoV827 Рік тому +302

    Great video! I didn't know about Act, I'm gonna install it RN.
    I would like to add:
    I recommend using paths-ignore (inside push and below branches) to trigger a specific workflow only when a specific path is involved.
    For example if the docs folder is another project, if you push a readme update inside the project, all the workflow will run test again wasting you free minutes. With paths-ignore you can specify which path to ignore.

    • @querela92
      @querela92 Рік тому +9

      Yes, I found this trick recently and this was great for only building/testing those modules that changed.

    • @marty0678
      @marty0678 Рік тому +11

      Act doesn't run 1:1 to GitHub Actions, doesn't support all third party actions, and is missing a few feature parity things that will crash with Act but works fine on Actions but it's still a huge life saver when testing 80% of things.
      Act also exposes act specific env variables so you can skip steps when running locally for example, which helps getting around some of these issues.

    • @ServetTonga
      @ServetTonga Рік тому

      @@marty0678 I agree, something may fail in act but work in actions.

    • @sungjuyea4627
      @sungjuyea4627 Рік тому +1

      I tried it several times but it seems like they don't work on macOS? I might be missing sth but from my experience act didn't work for me.

    • @ServetTonga
      @ServetTonga Рік тому

      @@sungjuyea4627 I use it on macOS

  • @snowdane3920
    @snowdane3920 Рік тому +271

    The timing of this tutorial... I've been meaning to use GitHub actions to maintain a npm package... This couldn't have come out at a better time

    • @YuriG03042
      @YuriG03042 Рік тому +1

      He already did a smaller video about it on the main channel 2 or 3 years ago. The only difference is that he used Node 12 back then which is either deprecated or downright removed now (can't remember what the Github blog post mentioned).

    • @ウタ-u1g
      @ウタ-u1g Рік тому

      What’s your package about ?

    • @snowdane3920
      @snowdane3920 Рік тому

      @@YuriG03042 I seem to have missed that video somehow 🙈

    • @snowdane3920
      @snowdane3920 Рік тому

      @@ウタ-u1g it's a fork of unmaintained calendar library for vue which I am slowly modifying for my office's needs

    • @neutron417
      @neutron417 Рік тому +1

      I've just used it to add latest blogs to my readme lol

  • @arjix8738
    @arjix8738 Рік тому +20

    @Beyond Fireship Actually, if the project repo is public, then the workflows are free w/o limit (other than the 6 hour limit that all workflows have)
    the 2000 free minutes are for private repositories

  • @kevinandeleven
    @kevinandeleven Рік тому +68

    Hosted runners are life savers.. I basically use them for all my server work.. Once🎉 I push code, a self hosted runner running on the servers pulls the changes and restarts the server

    • @woops30
      @woops30 Рік тому

      I configured a self hosted runner on digitalocean. Do you know if it's possible to have multiple self hosted runners on the same VM? maybe with containers or something like that?

    • @kevinandeleven
      @kevinandeleven Рік тому

      @@woops30 no idea

    • @paologaleotti8478
      @paologaleotti8478 6 місяців тому

      @@woops30 it is, simply start multiple and make sure they are named differently

  • @Im_Ninooo
    @Im_Ninooo Рік тому +330

    10x is not a verb, sir

  • @roaringfork
    @roaringfork Рік тому +112

    Github Actions actually spins up a whole vm. There are very specific circumstances in which this is important as I spent two weeks learning.

    • @ZeroYT
      @ZeroYT Рік тому +13

      What circumstances?

    • @uuu12343
      @uuu12343 Рік тому

      TIL in theory, you can self-hosted github actions if there's a way to redirect the builder
      To be fair, that would mean you are not using github lmao

    • @Bash70
      @Bash70 Рік тому +10

      It doesn't have to use a whole vm. I configured a docker container to act as a runner so I could run nested docker containers inside of it.

    • @thekwoka4707
      @thekwoka4707 Рік тому +11

      @@Bash70 it still uses a full VM to run your action container.

    • @Bash70
      @Bash70 Рік тому

      @@thekwoka4707 Like I said, it depends on how the runner is setup. The runners that Github itself uses are full VMs but you can setup up your own self-hosted runners that are just containers.

  • @NaveenKumar-nw4re
    @NaveenKumar-nw4re Рік тому +25

    Currently working on setting CI/CD on a project. what a time to upload the video👌

  • @Sefton.
    @Sefton. Рік тому +17

    This is my favourite type of content, covering stuff nearly every developer uses or should be using and showing tips, tricks etc.

  • @stephenson127
    @stephenson127 Рік тому +7

    How do you automate versioning? Do you have to version bump manually in yml with each release?

    • @dandogamer
      @dandogamer Рік тому +4

      Use semantic versioning, it looks at your conventional commits to determine version based off the commit message

    • @stepansigut1949
      @stepansigut1949 Рік тому +1

      Versioning with commit messages is a bad idea - you will run into conflicts during merges. Use git tags to version and inject tag values into your project files during build if you need to access the version from code.
      Git tags can be also used to trigger special actions which do not get triggered otherwise (e.g. run deploy, build docs, run database migrations…)

    • @nandertga
      @nandertga Рік тому

      Assuming you're using semantic versioning and conventional commits in your project, you can use a tool like semantic release to automagically determine the next version number.

  • @tomchapman128
    @tomchapman128 Рік тому +13

    The selfhosted runners are super easy to set up, i did it and that way you also dont hsve any rate limits!

    • @Bash70
      @Bash70 Рік тому

      It depends. For me, I have a M1 laptop and it wasn't functioning properly when I set it up as a runner so I had to go about configuring a docker container as a runner so I could then run nested containers inside of it, which was excruciating.

    • @bryce.ferenczi
      @bryce.ferenczi Рік тому +3

      As long as you recognise the warning they include with the option, if someone makes a pr on your public repo and it triggers some test, then whatever code they submitted will be run on your machine which may include malware.

    • @tomchapman128
      @tomchapman128 Рік тому

      @@Bash70 oh yeah I hadn't considered Macs, I ran mine on Linux but yeah I guess other OSs could definitely make things more difficult

  • @mattd5419
    @mattd5419 Рік тому +9

    I had no idea something like act existed, you just saved me a shit ton of time!

  • @ra2enjoyer708
    @ra2enjoyer708 Рік тому +3

    6:13
    I fucking love cron magic strings, this for sure won't backfire in the future.

  • @JavArButt
    @JavArButt Рік тому +7

    Within the first 16 seconds, I had to laugh/smile multiple times. Your sense of humor is great. Also, the time and deep thoughts you spend int this work is clearly visible.

  • @Malephex
    @Malephex Рік тому +2

    I can't tell you how much time I've wasted in the past, pushing 1 byte changes to make a CI pipeline run while debugging the flow, all the time wishing I could just run the damn yaml/json/whatever file locally to simulate the CI/CD server ... thanks for the "act" tip!

  • @flyingpanhandle
    @flyingpanhandle Рік тому +5

    I like to use Volta in my projects, handily you can then use Volta in your GHA pipeline. No need to specific node or npm/pnpm/yarn versions any more. It will use exactly the version the project was developed on. Which is fantastic when upgrading node version.

  • @sigstackfault
    @sigstackfault Рік тому +12

    Do GitLab next? Would help a lot of us which have Corporate GitLab servers

    • @lawrencedoliveiro9104
      @lawrencedoliveiro9104 Рік тому

      All these features are not compatible between the different services. That’s why I try to stick to common functionality.

  • @ivandimitrov4410
    @ivandimitrov4410 Рік тому +4

    I've been doing some GitHub actions with install-nix-action and then running 'nix build' which covers all dependencies and declaratively builds the project. Maybe you can make a video on nix next.

  • @alanscodelog
    @alanscodelog Рік тому +23

    I've been using this setup (actions/act) but with semantic-release for a while. It's perfection. Don't even have to think about bumping versions / changelogs / publishing. Also you can create a little workflow badge to put on the repo or to keep a link to. Nice for having an overview of the state of several repos.

  • @thekwoka4707
    @thekwoka4707 Рік тому +2

    I disagree with npm CI for these.
    I use pnpm and cache the store (and even node modules itself) to speed up actions (cache key is the package-lock hash)
    Npm is slow, and CI prevents any caching options.

  • @Beryesa.
    @Beryesa. Рік тому +3

    GitLab CI 😏

  • @jenewland1999
    @jenewland1999 Рік тому +6

    Great video, Jeff! 🔥 Was so great to learn about act - I looked for a solution like this a while back and couldn't find anything. Quick question though: Is there any specific reason for using v2 over v3 of actions/checkout and action/setup-node?

    • @GamesterTheBest7
      @GamesterTheBest7 Рік тому

      Yuh much agreed. @v2 is going to give a deprecation warning for node 12.

  • @shateq
    @shateq Рік тому +1

    Lol, who uses main and master branch's name at the same time

  • @MusicalGeniusBar
    @MusicalGeniusBar Рік тому +1

    Wait, this is about testing my project, I’m out 😂

  • @tannercampbell
    @tannercampbell Рік тому +1

    you mean you don’t have like dozen of commits “CI TEST”? would love a breakdown on that act tool!

  • @erik-fisher
    @erik-fisher Рік тому +5

    Man, this AI voice is good!

  • @Kaszanas
    @Kaszanas 8 місяців тому +1

    I use a slightly different approach where I run a container inside GitHub Actions and run all of the commands against that container which acts as a development container too. So I achieve a couple of things at the same time. I do not need act to test my actions because all of the logic behind my actions is containerized anyway.

  • @alexpiano
    @alexpiano 10 місяців тому

    Great videos as always
    If you somehow modulated your voice a bit when you speak it wouldn't sound so "robotic", and no need to suppress all pauses, breath a little! you already got many subscribers, no need to fear loss of attention
    Have a nice day

  • @offantik
    @offantik Рік тому +1

    hi I noticed that you use v2 actions that produce tons of warnings about nodejs deprecating, can you use v3?

  • @Go_with-Christ
    @Go_with-Christ Рік тому +1

    So.. Jenkins for soy devs?

  • @georgiosmylonas3892
    @georgiosmylonas3892 5 місяців тому +1

    Love it! Straight and concise! Thank you!

  • @rushikeshsherekar4482
    @rushikeshsherekar4482 Рік тому +1

    Dude if I implement the automated test while a release on git i will lose my job 😶… and before ai, i will be the one to make my job absolute 😶

  • @magicking3888
    @magicking3888 Рік тому +2

    Is it possible to configure github actions to auto deploy to a custom server instead of big company servers like azure or aws?

  • @omomer3506
    @omomer3506 Рік тому

    CV/Resume
    Skills:
    Ci/CD expert

  • @yousifakbar
    @yousifakbar Рік тому +8

    I don't think it's technically true that GitHub spins up a container when you start a workflow. I believe they connect you to a full VM.

    • @dingus4138
      @dingus4138 Рік тому +2

      They use microvms and spin up containers inside them for certain action types. But a lot of it can be done using the base VM.

    • @MrAjiii
      @MrAjiii Рік тому +1

      They're all containers!

  • @tyreldelaney
    @tyreldelaney Рік тому +1

    I did not know about the act package, that's a pretty nifty tool

  • @islamouda356
    @islamouda356 Рік тому +2

    I will debug myself to learn more from you

  • @moccaloto
    @moccaloto Рік тому

    So .. a batch file 😂😂
    Should've called it BatMan: Batch Manager

  • @username4794
    @username4794 Рік тому

    Lol…act…Tell me that after running 100 builds like a savage to test my action

  • @cariyaputta
    @cariyaputta Рік тому +1

    Thanks. Didn't know Act before, so every time I want to change the workflow I have to wait for the whole run like an idiot.

    • @Bash70
      @Bash70 Рік тому +1

      Act is pretty limited though. Doesn't work for trigger inputs and in my case, I had to actually run a nested container for my tests so Act was pretty much useless.

  • @Offe2246
    @Offe2246 6 місяців тому

    If I give gpt the link of the video can build the app automatically?

  • @Hermesiss
    @Hermesiss Рік тому

    I think I heard the basement slaves at 7:32 doing animations for the daily code reports

  • @brianschonecker4336
    @brianschonecker4336 Рік тому

    Holy hell, man. This is supposed to be a tutorial - slow down...

  • @VaibhavShewale
    @VaibhavShewale Рік тому +1

    ooh damn, thats very cool!

  • @SoreBrain
    @SoreBrain Рік тому +1

    I can't believe I didn't know about act

  • @emanuelescarsella3124
    @emanuelescarsella3124 Рік тому +1

    I would have liked a video like this when I first learned GitHub actions, but still now I have to configure a new more complex project so that's still a good timing for me❤

  • @deimne970
    @deimne970 Рік тому

    Sorry, but Microsoft currently owns Github, so... Microsoft already knows all about your code and maybe it's doing weird things with it like train neural networks in OpenAI laboratories using Azure compute power... 😁

  • @wlockuz4467
    @wlockuz4467 Рік тому +1

    Calling it life-saver is an understatement to be honest.

  • @timeflier350
    @timeflier350 14 днів тому

    Soo many things too install, it's overhwelming

  • @boro057
    @boro057 Рік тому +1

    Cool, I understood some of the words in this one!

  • @mohsinejaz6882
    @mohsinejaz6882 Рік тому

    Hey fireship do tutorials on legend state for react

  • @blasttrash
    @blasttrash Рік тому

    github actions is bad. You cant do dynamic sequential jobs. Like say I want to run job1, then job2, ....then jobn. You can do this only if you know the value of n beforehand and hardcode these jobs. However if you want to customize this n, then you need to use strategy matrix which only allows you to see them parallely in their GUI(even with maxParallel set to 1). Also manually stopping the workflow never works lol. Very bad design

  • @filipsworks
    @filipsworks Рік тому

    Not bad at all, but self hosted runners on some proxmox running on old crappy hardware + uploading playwright traces as artifacts are GOATs

  • @vitalysuper3193
    @vitalysuper3193 Рік тому

    0:00 that sound make subwoofers hit me in the back. aa

  • @blackjackjester
    @blackjackjester Рік тому +1

    Master branch keep the faith brother

  • @DevThought
    @DevThought Рік тому +1

    Act is not working on M1 macbook.

  • @Jacur1980
    @Jacur1980 Рік тому

    AI voice or it is some YT compression I am hearing 😵

  • @Raress96
    @Raress96 Рік тому

    You have both main and master branches?
    What is this madness branching strategy? :))

  • @SamRussell-NL
    @SamRussell-NL 2 місяці тому

    Great video - lots of useful resources and content

  • @Valuvsn
    @Valuvsn 11 місяців тому

    Correct it's an adjective in tech

  • @keyboard_g
    @keyboard_g Рік тому

    Fireship runs Windows. Interesting.

  • @duhby
    @duhby 6 місяців тому

    7:58 a use case for self-hosted runners is if you run docker containers on a vps and want to automate the creation of images without having to git pull and run the commands yourself every time

  • @oktopus_prime
    @oktopus_prime Рік тому +1

    Have you had any experience shortening that feedback loop earlier on the process, let's say at the pre-commit timeframe? I ask because we would commit things up to the repo to fire off a pipeline and then get fredback a few minutes later. It felt nicer (to me) to abort our commit if our tests, or linting failed. Yes there is always the option to force it through, but I liked that immediate feedback locally before something small and dumb was sent up.

    • @thekwoka4707
      @thekwoka4707 Рік тому +2

      Yeah, unit tests and linting and formsttkng should be pre-commit since they should be very fast.
      Then they can also be in the PR and the PR can also have the longer processes like e2e tests, builds, etc.

  • @OceanSlim
    @OceanSlim 4 місяці тому

    need forgejo video. gitea with actions

  • @kazaakas
    @kazaakas Рік тому

    All good practices, but these can be achieved with a number of SaaS CI/CD tools, not just github actions.

  • @nexovec
    @nexovec Рік тому

    It's drone CI all the way for me.

  • @paulhetherington3854
    @paulhetherington3854 Рік тому

    TTY don't - have any commands.

  • @yokowasis
    @yokowasis Рік тому

    something important missing, you should have explain how to deploy the code on your production machine upon code push.

  • @sevdalink6676
    @sevdalink6676 Рік тому

    I have used github actions to trigger tests on every push. But I experienced very slow behavior. Even for a very small small project it took tens of minutes to complete. Is it normal to take so long?

  • @uuu12343
    @uuu12343 Рік тому

    Brb gonna write-up a guide on Github Actions, am not gonna plow through life without a CI/CD engine

  • @aravindakumar4116
    @aravindakumar4116 Рік тому

    After seeing fireship, me going to create an Issue on my lead's code, "Why your code sucks?"

  • @frittex
    @frittex Рік тому +1

    very wise indeed

  • @braitschsf
    @braitschsf Рік тому

    Here are 27 hoops you can jump through to make your life easier

  • @smthngsmthngsmthngdarkside
    @smthngsmthngsmthngdarkside 6 місяців тому

    Use ASDF instead of node setup

  • @AmodeusR
    @AmodeusR Рік тому

    Where was written the playwright test code? I only saw you linking it to the actions or something like that, but you never made the code that makes the test. I don't get it.

  • @iqmal
    @iqmal Рік тому

    Github action ftw

  • @thekwoka4707
    @thekwoka4707 Рік тому

    Should have clarified that GitHub actions are free for public repos.

  • @netlemon
    @netlemon Рік тому

    what I don t like about Github Actions is that it doesn t support yml aliases which makes the file quite cluttered for big ci cds pipelines

  • @Caringal_Tech
    @Caringal_Tech Рік тому

    Make GitHub Actions with AWS ECS with EC2

  • @flareflo362
    @flareflo362 Рік тому

    the free tier is billed on private repos... public repos are entirely free!

  • @baychaoz
    @baychaoz Рік тому

    Please make a video about nx

  • @AdityaKumar-cy2cr
    @AdityaKumar-cy2cr Рік тому

    VS code Theme and icon Please

  • @horrorcoder
    @horrorcoder 5 місяців тому

    still overly complicated

  • @devabdultech
    @devabdultech Рік тому

    watched it now, got the basic idea but im currently not using or planning to use or learn it now. I'll be back soon :)

  • @thelinuxlich
    @thelinuxlich Рік тому

    The only thing missing here is caching the playwright installation

  • @StudyStreamPlus
    @StudyStreamPlus 9 місяців тому

    Love your videos bro. Thanks.

  • @thantzinoo938
    @thantzinoo938 Рік тому

    I wonder how firebase functions are work with GitHub actions?

  • @whichmann9617
    @whichmann9617 Рік тому

    This is truly great but I just wish there was a feature that would automate that one thing I need to manually do every day at my current project

  • @CrazyLuke11
    @CrazyLuke11 9 місяців тому

    Are you really using Astro to make svelte docs? 😂😂😂😂

  • @nomadvagabond1263
    @nomadvagabond1263 Рік тому

    Aa wise man once told me: why talk much when few words do trick

  • @kirillpenkin1535
    @kirillpenkin1535 Рік тому

    Hey) The video is awesome))) Thank you.
    I have a question thought: In a github issue page there s a button "create branch" (inside the Development section of the right panel). Is there a way to trigger an action that changes a state of the corresponding issue to inProgress when a branch is created using this button?
    I use github project to manage issues. Its awesome too)

  • @illegalsmirf
    @illegalsmirf Рік тому

    For an 'automated' solution that sure sounds complex and convoluted.

  • @henrycullen950
    @henrycullen950 Рік тому

    Could you please do a video on free tools and services? It would be very handy after the death of heroku

  • @samuelmorgan-tyghe9136
    @samuelmorgan-tyghe9136 Рік тому

    I gave up on making some ai that reads the code / commit messages and finds relevant memes to it and adds it to the or description

  • @hakuna_matata_hakuna
    @hakuna_matata_hakuna Рік тому

    you can;t spell lame without yaml , dagger better

  • @09487abc
    @09487abc 6 місяців тому

    謝謝分享

  • @savire.ergheiz
    @savire.ergheiz Рік тому

    You clearly need to get some action since you always said master instead of main 😂

  • @razdingz
    @razdingz Рік тому

    i like sweaty women

  • @metaorior
    @metaorior Рік тому

    ~kiiji

  • @blaizeW
    @blaizeW Рік тому

    idk i just use the google action lol aka release please

  • @thomas6502
    @thomas6502 Рік тому

    Ah yes, who doesn't love the model: "The first one is free..."