diff --git a/action.yml b/action.yml index e20e133..94859ba 100644 --- a/action.yml +++ b/action.yml @@ -5,6 +5,9 @@ inputs: description: "Branch or ref to check out in the caller repository" required: false default: "main" + destination: + description: "Destination directory for the autodeploy scripts (relative to the repository root)" + required: true runs: using: "composite" @@ -15,15 +18,20 @@ runs: fetch-depth: 0 persist-credentials: true ref: ${{ inputs.branch }} + path: tmp + + - name: Deploy files + run: rsync -rlv "${GITHUB_WORKSPACE}/tmp/" "${{ inputs.destination }}/" + shell: bash - name: Copy autodeploy into workspace run: | - cp -R "$GITHUB_ACTION_PATH/autodeploy" "$GITHUB_WORKSPACE/" + $GITHUB_ACTION_PATH/autodeploy/setup.sh "${{ inputs.destination }}" shell: bash - - name: Run autodeploy setup script - working-directory: ${{ github.workspace }} - run: | - chmod +x autodeploy/setup.sh - ./autodeploy/setup.sh - shell: bash + # - name: Run autodeploy setup script + # working-directory: ${{ github.workspace }} + # run: | + # chmod +x autodeploy/setup.sh + # ./autodeploy/setup.sh + # shell: bash diff --git a/autodeploy/download.sh b/autodeploy/download.sh index 1c14129..260ed94 100755 --- a/autodeploy/download.sh +++ b/autodeploy/download.sh @@ -79,7 +79,7 @@ function download() { fi echo "Downloading $url ..." - rm "$archive" "$binary" || true + rm -f "$archive" "$binary" || true curl --location --silent --show-error --remote-time --output "$archive" "$url" tar xzf "$archive" } diff --git a/autodeploy/setup.sh b/autodeploy/setup.sh index 06c84b5..8a184b7 100755 --- a/autodeploy/setup.sh +++ b/autodeploy/setup.sh @@ -2,6 +2,8 @@ set -euo pipefail +DESTINATION_DIR="$1" +echo $DESTINATION_DIR # URL="https://github.com/prefix-dev/pixi/releases/latest/download/pixi-x86_64-unknown-linux-musl.tar.gz" URL="https://gitea.psi.ch/python/pixi/releases/download/latest/pixi-x86_64-unknown-linux-musl.tar.gz"