@privsec said in Connecting the LAMP app with Git:
(I want to push to this directory, rather then to public)
Note on that.
The action runs:
cloudron push --app ${CLOUDRON_APP_ID} ${GITHUB_WORKSPACE}/. ${CLOUDRON_PUSH_DESTINATION}
Be aware of the /. after ${GITHUB_WORKSPACE}.
From the cloudron cli:
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/*
Meaning, if you set CLOUDRON_PUSH_DESTINATION: "/app/data", yes, everything in the GitHub repository will be pushed to /app/data, but be aware, this does not delete existing files.
So, if you have the file /app/data/historic.txt and this is not in your GitHub repo, after the action has run, this file will still exist.
This could be seen as inconvenient, but, let's take the following scenario:
You have the folder /app/data/static/images which holds all your static image assets and in the GitHub repo you have static/images/.gitkeep an empty folder that is still tracked by git but empty.
If I changed the GitHub Action to overwrite the CLOUDRON_PUSH_DESTINATION instead of copying into it, all the /app/data/static/images files would be deleted.
Just wanted to make you aware of that