Using the app with Github Actions
-
Hi!
I want to deploy an 11ty static site to Cloudron, and if possible build it and deploy everytime I push new content to the sites Github repo. Is it possible to push to this app from a Github account, or is it only push from a local repo that's possible?
I think the later, and if I'm right: Is there any other way to push a build from a Github account to some other Cloudron app?
/Anders
-
BrutalBirdie Partnerwrote on Apr 20, 2024, 2:26 PM last edited by BrutalBirdie Apr 20, 2024, 2:30 PM
Yes you can, you need the
cloudron-cli
and a Cloudron token. Then you can use thecli
in the action with the secret token to push the repo into the/app/data/<placeholder>
app.cloudron push --help Usage: cloudron push [options] <local> <remote> push a single local file or directory to a remote directory Options: --app <id/location> App id or location -h, --help display help for command Examples: $ cloudron push --app myapp file.txt /app/data/file.txt # pushes file.txt $ cloudron push --app myapp file.txt /app/data/ # pushes file.txt. trailing slash is important $ cloudron push --app myapp dir /app/data # pushes dir/* as /app/data/dir/* $ cloudron push --app myapp dir/. /app/data # pushes dir/* as /app/data/* $ cloudron push --app myapp dir/subdir /app/data # pushes dir/subdir/* as /app/data/subdir/* $ cloudron push --app myapp . /app/data # pushes .* as /app/data/*
-
But both the cli solutions are to be run locally, from my desktop? Or could they be used on GitHub as well?
-
Anything you can run on the cli you could also run in a ci system such as GitHub actions. Here is an example: https://forum.cloudron.io/topic/3678/build-deploy-to-cloudron-from-github-actions
-
Ah, thanks! I’m just getting started with Git/Github, so wasn’t aware of that.
4/6