File tree Expand file tree Collapse file tree 5 files changed +17
-3
lines changed
Expand file tree Collapse file tree 5 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ deploy:
3333 GIGALIXIR_APP : my-gigalixir-app # Feel free to also put this in your secrets
3434 SSH_PRIVATE_KEY : ${{ secrets.SSH_PRIVATE_KEY }}
3535 MIGRATIONS : false # defaults to true
36+ APP_SUBFOLDER : my-app-subfolder # Add only if you want to deploy an app that is not at the root of your repository
3637` ` `
3738
3839## Migrations
Original file line number Diff line number Diff line change @@ -17,6 +17,9 @@ inputs:
1717 description : ' Configuration for migrations'
1818 required : true
1919 default : true
20+ APP_SUBFOLDER :
21+ description : ' Subfolder of your app'
22+ required : false
2023
2124runs :
2225 using : ' node12'
Original file line number Diff line number Diff line change @@ -1093,6 +1093,7 @@ async function run() {
10931093 const sshPrivateKey = core . getInput ( 'SSH_PRIVATE_KEY' , baseInputOptions ) ;
10941094 const gigalixirApp = core . getInput ( 'GIGALIXIR_APP' , baseInputOptions ) ;
10951095 const migrations = core . getInput ( 'MIGRATIONS' , baseInputOptions ) ;
1096+ const appSubfolder = core . getInput ( 'APP_SUBFOLDER' , { required : false } ) ;
10961097
10971098 await core . group ( "Installing gigalixir" , async ( ) => {
10981099 await exec . exec ( 'pip3 install gigalixir' )
@@ -1113,7 +1114,11 @@ async function run() {
11131114 core . info ( formatReleaseMessage ( currentRelease ) ) ;
11141115
11151116 await core . group ( "Deploying to gigalixir" , async ( ) => {
1116- await exec . exec ( "git push -f gigalixir HEAD:refs/heads/master" ) ;
1117+ if ( appSubfolder ) {
1118+ await exec . exec ( `git subtree push --prefix ${ appSubfolder } gigalixir master` ) ;
1119+ } else {
1120+ await exec . exec ( "git push -f gigalixir HEAD:refs/heads/master" ) ;
1121+ }
11171122 } ) ;
11181123
11191124 if ( migrations === "true" ) {
Original file line number Diff line number Diff line change @@ -85,6 +85,7 @@ async function run() {
8585 const sshPrivateKey = core . getInput ( 'SSH_PRIVATE_KEY' , baseInputOptions ) ;
8686 const gigalixirApp = core . getInput ( 'GIGALIXIR_APP' , baseInputOptions ) ;
8787 const migrations = core . getInput ( 'MIGRATIONS' , baseInputOptions ) ;
88+ const appSubfolder = core . getInput ( 'APP_SUBFOLDER' , { required : false } ) ;
8889
8990 await core . group ( "Installing gigalixir" , async ( ) => {
9091 await exec . exec ( 'pip3 install gigalixir' )
@@ -105,7 +106,11 @@ async function run() {
105106 core . info ( formatReleaseMessage ( currentRelease ) ) ;
106107
107108 await core . group ( "Deploying to gigalixir" , async ( ) => {
108- await exec . exec ( "git push -f gigalixir HEAD:refs/heads/master" ) ;
109+ if ( appSubfolder ) {
110+ await exec . exec ( `git subtree push --prefix ${ appSubfolder } gigalixir master` ) ;
111+ } else {
112+ await exec . exec ( "git push -f gigalixir HEAD:refs/heads/master" ) ;
113+ }
109114 } ) ;
110115
111116 if ( migrations === "true" ) {
You can’t perform that action at this time.
0 commit comments