Hello again my fellow artisans!!
In this article, I will go through the step-by-step process of how you can automate your Laravel app deployment...
For further actions, you may consider blocking this person and/or reporting abuse
This is a very helpful article that I use as a reference and keep visiting over and over. However, I leave this note comment as a future reference and help for myself and others.
Because the Laravel app uses
npmto build its assets and thus also thedeploy.shscript on the server, then thedeploy.ymlneeds to indicate that the github action server also needsnpmto build the assets. So to thedeploy.ymlfile you need to add the following:And if you are using
nvmon the server to install node then maybe you need to add the following to thedeploy.shscriptthank you for this post, following it helped me set my continuous deployment using laravel and github actions, however some small things are missing in this guide.
For example you need to grant execution permissions on your server for the ./.scripts/deploy.sh in order for it to be able to execute
Thank you for pointing that out, its updated now.
Thanks for your post. I have created two workflows one for staging one for prod. When I run $ git fetch
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
@precampio as @hammykl20 pointed out you need to add github to the ssh known_hosts list like the following:
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hostsHowever, this is not enough as you have to also add your public key
id_rsa.pubto your github account by going to your account's settings, clicking on "SSH and GPG keys," and then clicking "New SSH key."Then just to be safe I would run the following two commands:
eval "$(ssh-agent -s)"ssh-add ~/.ssh/id_rsastackoverflow.com/questions/133635...
When I run following command replacing with my repo ssh key on my vps:
git remote set-url origin git@github.com:USERNAME/REPOSITORY.gitit give
fatal: No such remote 'origin'error.Can you please help me in this? do I need to login with github credentials?
A note to myself and whoever facing similar issues
If deploying a new repo, first need to clone it on server using (make sure both ssh keys have been added on github):
git clone git@github.com:USERNAME/REPOSITORY.gitcloning will auto set origin to current repo but you can check once using below command:
git remote -vIn case no origin found, then add origin using:
git remote set-url origin git@github.com:USERNAME/REPOSITORY.gitas you may need to make some permission changes (such as inside storage directory or .script directory) so ignore permission changes tracking using below command else your next action will fail:
git config core.fileMode falseHi, i've followed all the instruction, and i ended up getting this error,
Run appleboy/ssh-action@master
Run echo "$GITHUB_ACTION_PATH" >> $GITHUB_PATH
Run entrypoint.sh
Will download drone-ssh-1.7.4-linux-amd64 from github.com/appleboy/drone-ssh/rele...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 5580k 100 5580k 0 0 16.5M 0 --:--:-- --:--:-- --:--:-- 16.5M
======CMD======
cd /var/www/travellist && ./.scripts/deploy.sh
======END======
2024/05/05 03:45:01 dial tcp :: connect: connection timed out
i don't know what's wrong, i've tried to add timeout: 3600s to the deploy.yml, but it's still not working
I am not quite sure why you are getting this error but the following points might help debugging
Thanks mate..