Deploy Github actions.
- Test Ionos Shared Hosting (Using
appleboy/ssh-action@master
) Try this First - HostGator Shared Hosting (Using
fifsky/ssh-action@master
)
This guide helps you configure SSH for deploying your Laravel application using GitHub Actions on a shared hosting environment.
Connect to your hosting server via SSH using the terminal or command prompt:
ssh username@host.com
Navigate to the .ssh
folder on your server:
cd ~/.ssh
Generate SSH keys using ssh-keygen
. You can optionally provide a name (e.g., github-actions
) and a passphrase:
ssh-keygen -t rsa -b 4096
Or simply run:
ssh-keygen
This creates two files: github-actions
(private key) and github-actions.pub
(public key).
Add the public key (github-actions.pub
) to the authorized_keys
file to allow machines using the private key to access the server:
cat github-actions.pub >> ~/.ssh/authorized_keys
- Copy the content of
github-actions.pub
. - Go to your GitHub account settings.
- Navigate to
Settings
>SSH and GPG keys
>New SSH key
. - Provide a title (any) and paste the copied key.
- Save the key.
- Go to your repository settings.
- Navigate to
Settings
>Secrets
>Actions
. - Add the following repository secrets:
SSH_HOST
: Your host address (e.g.,host.com
or IP address).SSH_USERNAME
: Your SSH username.SSH_KEY
: The private key name (github-actions
).SSH_PORT
: your ssh port (optioinal, default is port 22)
For using github-actions
, run:
cat ~/.ssh/github-actions
Copy the output and save it to SSH_KEY.
For further guidance on setting up GitHub Actions for Laravel, you can refer to the following resources:
- GitHub Actions Deployment Guide
- YouTube Tutorial on GitHub Actions Deployment
- Example Repository: Laravel Social Media Website
- Medium Article on Building and Deploying Laravel with GitHub Actions
- Dev.to Guide on GitHub Actions for Laravel
- Github Action - Stepup Node.js and Yarn etc.. Feel free to explore these resources for more insights into deploying Laravel applications with GitHub Actions.