Files
scripts/.github/workflows/update-download.yml
dependabot[bot] a4236e1e88 Bump actions/download-artifact from 2 to 3 (#16)
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>
2022-06-18 13:46:42 +02:00

50 lines
1.2 KiB
YAML

name: Update CDN
on:
workflow_dispatch:
workflow_call:
secrets:
KEY_TORRENTS:
required: true
USER_TORRENTS:
required: true
HOST_TORRENTS:
required: true
KNOWN_HOSTS_TORRENTS:
required: true
jobs:
torrents:
name: Update
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 torrent
if: ${{ env.SKIP != 'yes' }}
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.KEY_TORRENTS }}
name: id_torrent # optional
known_hosts: ${{ secrets.KNOWN_HOSTS_TORRENTS }}
if_key_exists: replace
- name: Create torrents
if: ${{ env.SKIP != 'yes' }}
run: ssh -T -i ~/.ssh/id_torrent ${{ secrets.USER_TORRENTS }}@${{ secrets.HOST_TORRENTS }}