Laravel deployment with GitHub Actions

Поділитися
Вставка
  • Опубліковано 10 вер 2024

КОМЕНТАРІ • 110

  • @wisliylopes
    @wisliylopes 3 роки тому +3

    I have to thank you here too. This is the more detailed guide that I found on this subject. Thank you very much.

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

    I have used this script for a year now, excellent ;)
    It should be updated because github's set-output is getting deprecated and removed soon (FYI the link to the blog post points to 404).

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

      The article has been updated to include the changes :) Also fixed the link, thanks!

  • @iamnomana
    @iamnomana 2 роки тому +3

    Hi Philo, thanks for this excellent tutorial on CI/CD with Laravel. I've been searching for a video like this for some time now. I love how you explained each step. Thanks, once again.

    • @PhiloDev
      @PhiloDev  2 роки тому +1

      Thanks! Glad it was helpful!

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

    This is one of the best tutorials. Thanks for this excellent tutorial.

  • @steckrein6322
    @steckrein6322 2 роки тому +1

    I searched for this for a really long time. You helped me alot.

  • @nteej-mink
    @nteej-mink Рік тому

    Hi Philo,This is great tutorial I've followed it continous 2 days to get setup final working model.Thanks a lot for your great effort to build this nice tutorial.

  • @SouravRakshit_srv
    @SouravRakshit_srv 3 роки тому +1

    couldn't skip a sec it was that good & detailed. Thanks Phil ♥

  • @TrondHus
    @TrondHus 2 роки тому +1

    Hey Philo! This is great. I have been looking for something like this. Hopefully my days with FTP-uploads and forgetting files are gone. I will test this with a minor project I am currently working on.

  • @kohilankh2321
    @kohilankh2321 2 роки тому

    Very detailed explanation thank you buddy, do more like this on UA-cam please...

  • @kuzuru
    @kuzuru 3 роки тому +2

    Thank you very much, Philo!

    • @PhiloDev
      @PhiloDev  3 роки тому +1

      Thanks for leaving a comment 🙌🏼 I'm happy to hear that you enjoyed the video! More videos are coming so don't forget to subscribe 😄

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

    Thanks a lot Philo, A really informative and excellent explanation on CI/CD.
    Subscribed

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

      Thanks! That’s great to hear!

  • @vijaymchauhancom9739
    @vijaymchauhancom9739 2 роки тому +1

    Amazing content, thanks for sharing!

    • @PhiloDev
      @PhiloDev  2 роки тому

      Glad you enjoyed it!

  • @codelaravel
    @codelaravel 2 роки тому +1

    You are doing a great job.

  • @legitcyberlord869
    @legitcyberlord869 2 роки тому +1

    Awesome tutorial, really helpful.

    • @PhiloDev
      @PhiloDev  2 роки тому

      Glad it was helpful!

  • @rasyidzuhri540
    @rasyidzuhri540 3 роки тому +2

    Hi Philo.. im waiting for next vidio pleaseeee

  • @sudhirmitharwal
    @sudhirmitharwal 3 роки тому +1

    Love it

    • @PhiloDev
      @PhiloDev  3 роки тому

      Thanks Sudhir! 😄

  • @JustinVanOel
    @JustinVanOel 3 роки тому +1

    Awesome video Philo!

  • @danielneu9136
    @danielneu9136 2 роки тому +1

    Really, really awesome tutorial

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

    Very good quality! Nice job

  • @dreed47
    @dreed47 3 роки тому +1

    The parsing of the deployment-config.json fails for me. I get an error that says
    Error when evaluating 'strategy' for job 'prepare-release-on-servers'. (Line: 54, Col: 17): After parsing a value an unexpected character was encountered: {. Path '[0]', line 2, position 5.,(Line: 54, Col: 17): Unexpected value ''
    I've tried modifying the json ond tweaking the action parsing code but can't get it to work.

    • @PhiloDev
      @PhiloDev  3 роки тому

      Hi David, This error often occurs when the JSON is multi-line so I'm thinking that for some reason the JSON is not escaped. Could you verify the "Export deployment matrix" step? You can find the source code here: philo.dev/how-to-use-github-actions-build-matrix-to-deploy-artifacts-to-multiple-servers/

    • @buggxs
      @buggxs 3 роки тому

      This worked for me: echo "::set-output name=deployment-matrix::$(echo $JSON)"
      Also its written like this in the docs

    • @ustpromotion
      @ustpromotion 2 роки тому

      I got same problem here, extra one space, indetation may solve.

    • @BrianHammond04073
      @BrianHammond04073 2 роки тому

      @@buggxs Worked for me too! Thank you Andre!
      id: export-deployment-matrix
      run: |
      JSON="$(cat ./deployment-config.json)"
      JSON="${JSON//'%'/'%25'}"
      JSON="${JSON//'
      '/'%0A'}"
      JSON="${JSON//'
      '/'%0D'}"
      echo "::set-output name=deployment-matrix::$(echo $JSON)"

  • @pubudusj
    @pubudusj 3 роки тому +1

    Awesome stuff Philo

  • @MarcelloPato
    @MarcelloPato 2 місяці тому

    Damn FrontPage, we are old man!

  • @ronnieisurina6246
    @ronnieisurina6246 3 роки тому +1

    Thanks for sharing

  • @jabahunter
    @jabahunter 7 днів тому

    So good

  • @laduniestu
    @laduniestu 7 місяців тому +1

    Awesome Video! This tutorial is still works right now? for Laravel with Vite.

    • @PhiloDev
      @PhiloDev  7 місяців тому

      Yes! Still works, there is one minor change but you can see the updated blog article for more information 😄

  • @IlyesKechidi
    @IlyesKechidi 3 роки тому +1

    Awesome tutorial, keep up

  • @mikeglobal9084
    @mikeglobal9084 3 роки тому +2

    Hey Philo, this is amazing content, also, would be great to see how did you set up your phpstorm IDE that it fires the autocomplition on yml files, this is really amazing. Thanks!

    • @PhiloDev
      @PhiloDev  3 роки тому +1

      Hey Mike, thanks for your comment! I did a quick check but the autocompletion of the yml files is something phpstorm does automatically.

    • @mikeglobal9084
      @mikeglobal9084 3 роки тому

      @@PhiloDev Thank you for checking this out, I double checked as well and it doesn't seem to autocomplete on my side:(

    • @PhiloDev
      @PhiloDev  3 роки тому

      @@mikeglobal9084 it might be worth checking if the YAML plugin is enabled. Plugins -> YAML(this should be enabled by default though)

  • @user-nj7hu7ig8e
    @user-nj7hu7ig8e 6 місяців тому

    Hi Philo! Thx you for your efforts to make a good video.I have one important question to you:
    I am very inexperienced with deployment but I find it very dangerous to store the credentials in a json and upload it to the repository. Is that normal? I would have stored the crendetials as keys in GitHub secrets and only addressed them via variables in my deployment yml. What do you think?

    • @PhiloDev
      @PhiloDev  6 місяців тому +1

      Agreed! This was just for the tutorial to make it a bit easier. If you check out the blog article it will explain how to use SSH keys instead :)
      philo.dev/how-to-use-github-actions-build-matrix-to-deploy-artifacts-to-multiple-servers/

  • @sharktankdevelopment1977
    @sharktankdevelopment1977 2 роки тому

    Hi Philo, great video! Let me know if you are interested in a Laravel project...

  • @joant5036
    @joant5036 2 роки тому +1

    Nice video! Very, very useful!
    But I have a problem. I'm trying to deploy an existing full Laravel app, and I get a composer install error.
    composer install --no-dev --no-interaction --prefer-dist
    .....
    .....
    .....
    SQLSTATE[HY000] [2002] Connection refused (SQL: select column_name as `column_name` from information_schema.columns where table_schema = ***** and table_name = roles)
    Has anybody this same error?
    Thank you!!

    • @joant5036
      @joant5036 2 роки тому +1

      It was an error of "postAutoloadDump". I've temporary solved with
      composer install --no-dev --verbose --prefer-dist --optimize-autoloader --no-interaction --no-scripts;

    • @PhiloDev
      @PhiloDev  2 роки тому +1

      Happy to hear you enjoyed the video and solved the problem.

  • @jahiddev
    @jahiddev 3 роки тому +1

    Awesome video keep on.

    • @PhiloDev
      @PhiloDev  3 роки тому +1

      Thanks, will do!

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

    Thanks a lot Philo for the great tutorial.
    Can we use another directory outside public root to store artifacts, releases, storage and .env file? I think there is an security issue having .env in public root directory

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

      Thanks! Your .env is not in the public root directory. You should set the root directory to your-project/current/public (this is your Laravel's public folder, this doesn't contain the .env)

  • @rickbeniers667
    @rickbeniers667 2 місяці тому

    is deploying to kubernetets cluster around the same as for the services you are using?

    • @PhiloDev
      @PhiloDev  2 місяці тому +1

      @@rickbeniers667 not sure about that I’m not using Kubernetes. I guess it is somewhat similar but instead you build, push and deploy an image instead of a zip file.

    • @rickbeniers667
      @rickbeniers667 2 місяці тому

      @@PhiloDev ahh okay. I was playing around with docker images earlier so will try that next. thanks for the tip!

  • @superkajjin
    @superkajjin 2 роки тому

    Hi Philo thank you for this amazing tutorial! Just one questions regarding the deployments-config.json file that you commit in your repo and exposes all your servers sensitive data? do you think it could be a security risk? is there any way to have that file saved like github secrets or somewhere else where is more secure? thank you!!

    • @PhiloDev
      @PhiloDev  2 роки тому +3

      Hey Miguel, I'm happy to hear you liked the tutorial! Keeping sensitive data out of your repository is definitely good practice. Instead of loading the JSON file from your repository you can indeed put the contents of the file in a github secret as well and reference this in the deployment workflow.

  • @chetankharel4435
    @chetankharel4435 3 роки тому +1

    Loved it

    • @PhiloDev
      @PhiloDev  3 роки тому +1

      Thanks Chentan!

    • @chetankharel4435
      @chetankharel4435 3 роки тому +1

      Loved everything but permission can create security issues I think. www-data would be better in place of 0777

    • @PhiloDev
      @PhiloDev  3 роки тому +1

      @@chetankharel4435 Thanks for your feedback; I 100% agree. I'm trying to find the right balance between what to explain in-depth and what to keep simple. I think I can spend hours talking about server provisioning as well haha.

    • @chetankharel4435
      @chetankharel4435 3 роки тому

      @@PhiloDev Great I searched every videos on UA-cam to implement it finally cudos to you thanks 😊

  • @alexandermercyadeiza1796
    @alexandermercyadeiza1796 3 роки тому +1

    Hey Philo, this was an amazing tutorial, I did have one issue, I have breezed installed and pushed, but my login and register routes don't work, any thoughts?

    • @PhiloDev
      @PhiloDev  3 роки тому +1

      Thanks! Do any of your other routes work? This workflow should not have any effect on your routes. I'm using this exact same set up for all my applications without any routes issues.

    • @alexandermercyadeiza1796
      @alexandermercyadeiza1796 3 роки тому

      @@PhiloDev thanks for the response, really appreciate it. I installed Laravel breeze on local, then after I pushed to server using the flow, the login and register routes returns nginx 404 not found.

    • @alexandermercyadeiza1796
      @alexandermercyadeiza1796 3 роки тому

      I finally made this work, I had to vi into my nginx config file and add this line: try_files $uri $uri/ /index.php$is_args$args; I don't know why it happened, but this fixed the nginx 404 not found error on my routes. Thanks again Philo for sharing this.

  • @abdulwajid375
    @abdulwajid375 2 роки тому +2

    Kindly share the YML file

  • @JatinThapar
    @JatinThapar 3 роки тому

    Getting error:
    create folder /artifacts /var/www/html/artifacts
    23
    untar file c5yHb7EvxL.tar
    24
    error: tar: /var/www/html/artifacts: Not found in archive
    25
    tar: Exiting with failure status due to previous errors

    • @shahmirjadoon3587
      @shahmirjadoon3587 2 роки тому

      Gave your user permission to create folder inside /var/www/html folder

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

    This is an excellent tutorial; however, I was wondering if it could also be used with shared hosting.

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

      Yes, it could work if your hosting supports ssh access.

  • @lijahtech8200
    @lijahtech8200 3 роки тому +1

    Amazing content,loved every bit.
    How do I configure it on a shared hosting server(Apache)

    • @PhiloDev
      @PhiloDev  3 роки тому +1

      If you shared hosting has SSH support it will work just the same. If it doesn't I would recommend switching to a hosting provider that provides a VPS like DigitalOcean or AWS.

    • @lijahtech8200
      @lijahtech8200 3 роки тому

      @@PhiloDev thanks

  • @joant5036
    @joant5036 2 роки тому

    And ... .could you explain how to use ssh keys instead of name and password as access to production server?

    • @PhiloDev
      @PhiloDev  2 роки тому +2

      The blog article has been updated to include how to use SSH keys instead philo.dev/how-to-use-github-actions-build-matrix-to-deploy-artifacts-to-multiple-servers/

  • @kaddourbendahmamohamedelam707

    can you help me, links are not working and give me 404 error what di i do ?

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

    Hi Philo, this is a great tutorial, thank you. I have an issue on appleboy/scp-action , when scp to server I get: drone-scp error: stdin: is not a tty. Have you some ideas how to solve it?

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

      Thanks Stefano! It’s challenging to determine what causes that issue without knowing all the details. I would try the latest ubuntu distro and see if that solves the issue.

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

      @@PhiloDev Thanks, I'll try that.

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

    Is there any github repo for full code? Thanks

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

      No repo but you can find the code in the blog article :)

  • @lmn2392
    @lmn2392 2 роки тому

    keren banget

  • @sant1ago-da-hanoi
    @sant1ago-da-hanoi Рік тому

    hey, what if i use ssh key?

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

      See the following tutorial philo.dev/how-to-use-github-actions-build-matrix-to-deploy-artifacts-to-multiple-servers/

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

    It is outdated now, not working

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

      Github updates some actions and hence the code in yml file followed with is now no longer working and giving deprecation errors

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

      Thanks for the comment! The tutorial is over 2 years old, but it still works. However, you will get some deprecation errors. Luckily it only requires a few minor changes, which can be found in the blog article :)
      philo.dev/how-to-use-github-actions-build-matrix-to-deploy-artifacts-to-multiple-servers/

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

      @@PhiloDev Thanks, for the link. I will check this :)

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

      @@PhiloDev can you please give me the url to this updated .yml file? I'm lost and didn't know why I'm getting errors.

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

      @@PhiloDev for me the actions/checkout@v3 is not working with npm install and npm run dev/prod so I commented out the lines for npm and it worked, my app doens't need npm so i commented out but if someone's code need this, it has error

  • @hassucigar
    @hassucigar 2 роки тому

    Hi Philo,
    I am at 27:51 and the tutorial is going amazing, but I got stuck now, I am having error when pushed my code error is :
    tar all files into /tmp/2785375458/AmqnRwzLKN.tar
    scp file to server.
    create folder /var/www/html//artifacts // /var/www/html/artifacts
    untar file AmqnRwzLKN.tar
    error: tar: /: Not found in archive
    tar: /var/www/html/artifacts: Not found in archive
    tar: Exiting with failure status due to previous errors
    drone-scp error: Process exited with status 2
    drone-scp rollback: remove all target tmp file
    remove file AmqnRwzLKN.tar
    2022/08/18 10:39:20 Process exited with status 2
    can you help me with this, please?
    Regards
    Hasan Mehdi

    • @PhiloDev
      @PhiloDev  2 роки тому +1

      Seems like you may have made a typo. You can also use the article as a reference and check if everything is correct philo.dev/how-to-use-github-actions-build-matrix-to-deploy-artifacts-to-multiple-servers/

    • @hassucigar
      @hassucigar 2 роки тому

      @@PhiloDev Thanks alot. Can you make video on how to setup docker with laravel ?

    • @PhiloDev
      @PhiloDev  2 роки тому +1

      @@hassucigar if you want to use Laravel and Docker I recommend Laravel Sail. If you want to use Docker in production, Laravel Vapor or Fly.io are great solutions that takes care of all the things Docker related.

  • @mydentalscaler3462
    @mydentalscaler3462 2 роки тому +1

    Amazing content, thanks for sharing!

  • @shahmirjadoon3587
    @shahmirjadoon3587 2 роки тому

    Awesome tutorial, really helpful.