From 84bc8a890cacb5178e51d8c867669f1cb54972eb Mon Sep 17 00:00:00 2001 From: Carneiro Date: Thu, 5 Dec 2024 20:28:12 -0300 Subject: [PATCH] Update action.yml --- action.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 54707ee..6a442e5 100644 --- a/action.yml +++ b/action.yml @@ -9,6 +9,9 @@ inputs: dirname: description: "Site directory (inside src_dir) name" default: ${{ github.event.repository.name }} + output_dirname: + description: "Site destination directory name" + default: ${{ github.event.repository.name }} dest_dir: description: "Destination directory" default: "/var/www/html/alice_sites" @@ -36,7 +39,9 @@ runs: steps: - uses: appleboy/ssh-action@v1.2.0 env: + ORIG_DIRNAME: ${{ github.event.repository.name }} SITE_DIRNAME: ${{ inputs.dirname }} + OUTPUT_DIRNAME: ${{ inputs.output_dirname }} REPO_NAME: ${{ gitea.repository }} SKIP_BUILD: ${{ inputs.skip_build }} SOURCE_DIR: ${{ inputs.src_dir }} @@ -50,6 +55,8 @@ runs: envs: SITE_DIRNAME, REPO_NAME, SKIP_BUILD, SOURCE_DIR, DEST_DIR, JEKYLL_ARGS script: | + [ "$OUTPUT_DIRNAME" = "$ORIG_DIRNAME" ] && OUTPUT_DIRNAME=$SITE_DIRNAME + cd $SOURCE_DIR # If site is not there yet, clone it @@ -63,4 +70,4 @@ runs: # Build [ $SKIP_BUILD != false ] && exit 0 bundle install - bundle exec jekyll build $JEKYLL_ARGS --destination=$DEST_DIR/$SITE_DIRNAME + bundle exec jekyll build $JEKYLL_ARGS --destination=$DEST_DIR/$OUTPUT_DIRNAME