mirror of
https://github.com/armbian/scripts.git
synced 2026-01-06 10:32:48 -08:00
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 2 to 3. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
56 lines
1.3 KiB
YAML
56 lines
1.3 KiB
YAML
name: Sync servers
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
workflow_call:
|
|
inputs:
|
|
KEY_ID:
|
|
required: true
|
|
type: string
|
|
secrets:
|
|
KEY_UPLOAD:
|
|
required: true
|
|
USER_REPOSITORY:
|
|
required: true
|
|
HOST_REPOSITORY:
|
|
required: true
|
|
KNOWN_HOSTS_REPOSITORY:
|
|
required: true
|
|
|
|
jobs:
|
|
|
|
sync:
|
|
name: "Sync servers"
|
|
runs-on: [self-hosted, Linux, local]
|
|
if: ${{ github.repository_owner == 'Armbian' }}
|
|
steps:
|
|
|
|
- name: Remove previous artefacts if any
|
|
run: |
|
|
|
|
sudo rm -rf changes 2>/dev/null || true
|
|
|
|
- name: Download changes
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: changes
|
|
|
|
- name: Check
|
|
run: |
|
|
|
|
[ -s changes ] || echo "SKIP=yes" >> $GITHUB_ENV
|
|
|
|
- name: Install SSH key for repository
|
|
if: ${{ env.SKIP != 'yes' }}
|
|
uses: shimataro/ssh-key-action@v2
|
|
with:
|
|
key: ${{ secrets.KEY_UPLOAD }}
|
|
name: ${{ inputs.KEY_ID }}
|
|
known_hosts: ${{ secrets.KNOWN_HOSTS_REPOSITORY }}
|
|
if_key_exists: replace
|
|
|
|
- name: Update repository
|
|
if: ${{ env.SKIP != 'yes' }}
|
|
run: ssh -T -i ~/.ssh/${{ inputs.KEY_ID }} ${{ secrets.USER_REPOSITORY }}@${{ secrets.HOST_REPOSITORY }}
|