You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pekko.apache.org by jr...@apache.org on 2023/02/14 13:55:54 UTC

[incubator-pekko-http] branch main updated: add sync action necessary for documentation publishing (#54)

This is an automated email from the ASF dual-hosted git repository.

jrudolph pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-pekko-http.git


The following commit(s) were added to refs/heads/main by this push:
     new 9acf384b9 add sync action necessary for documentation publishing (#54)
9acf384b9 is described below

commit 9acf384b9110bc3a016ab9d5115e4e640fc4e099
Author: Johannes Rudolph <jo...@gmail.com>
AuthorDate: Tue Feb 14 14:55:48 2023 +0100

    add sync action necessary for documentation publishing (#54)
---
 .github/actions/sync-nightlies/action.yml | 86 +++++++++++++++++++++++++++++++
 1 file changed, 86 insertions(+)

diff --git a/.github/actions/sync-nightlies/action.yml b/.github/actions/sync-nightlies/action.yml
new file mode 100644
index 000000000..6a8deff54
--- /dev/null
+++ b/.github/actions/sync-nightlies/action.yml
@@ -0,0 +1,86 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Based on Apache Arrow's sync-nightlies action
+# https://github.com/apache/arrow/blob/master/.github/actions/sync-nightlies/action.yml
+name: 'Sync Nightlies'
+description: 'Sync files to and from nightlies.apache.org'
+inputs:
+  upload:
+    description: 'Sync from local to remote'
+    default: false
+    required: false
+  switches:
+    description: 'see rsync --help'
+    required: true
+  local_path:
+    description: 'The relative local path within $GITHUB_WORKSPACE'
+    required: true
+  remote_path:
+    description: 'The remote path incl. sub dirs e.g. {{secrets.path}}/arrow/r'
+    required: true
+  remote_host:
+    description: 'The remote host'
+    required: true
+  remote_port:
+    description: 'The remote port'
+    required: false
+    default: 22
+  remote_user:
+    description: 'The remote user'
+    required: true
+  remote_key:
+    description: 'The remote key'
+    required: true
+
+runs:
+  using: "composite"
+  steps:
+    - name: Sync files
+      shell: bash
+      env:
+        SWITCHES: "${{ inputs.switches }}"
+        LOCAL_PATH: "${{ github.workspace }}/${{ inputs.local_path }}"
+
+        SSH_KEY: "${{ inputs.remote_key }}"
+        PORT: "${{ inputs.remote_port }}"
+        USER: "${{ inputs.remote_user }}"
+        HOST: "${{ inputs.remote_host }}"
+        REMOTE_PATH: "${{ inputs.remote_path }}"
+      run: |
+        # Make SSH key available and add remote to known hosts
+        eval "$(ssh-agent)" > /dev/null
+        echo "$SSH_KEY" | tr -d '\r' | ssh-add - >/dev/null
+        mkdir -p .ssh
+        chmod go-rwx .ssh
+        echo "$HOST_KEY" >> .ssh/known_hosts
+        # strict errors
+        set -eu
+        # We have to use a custom RSH to supply the port
+        RSH="ssh -o StrictHostKeyChecking=no -p $PORT"
+        DSN="$USER@$HOST"
+        # It is important to append '/' to the source path otherwise
+        # the entire source dir will be created as a sub dir in the destination
+        if [ "${{ inputs.upload }}" = true ]
+        then
+          SOURCE=$LOCAL_PATH/
+          DEST=$DSN:$REMOTE_PATH
+        else
+          SOURCE=$DSN:$REMOTE_PATH/
+          DEST=$LOCAL_PATH
+        fi
+        rsync $SWITCHES --rsh="$RSH" $SOURCE $DEST


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pekko.apache.org
For additional commands, e-mail: commits-help@pekko.apache.org