Files
scripts/.github/workflows/sync-servers.yml
dependabot[bot] fb87d96ed7 Bump actions/download-artifact from 3.0.1 to 3.0.2 (#36)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 3.0.1 to 3.0.2.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v3.0.1...v3.0.2)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-17 12:07:11 +01:00

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.0.2
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 }}