-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12957 from daschuer/download_cleanup
Add CI runner that allows cleaning up the download server
- Loading branch information
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Clean up downloads | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: "Set up SSH Agent" | ||
if: github.event_name == 'push' && env.SSH_PRIVATE_KEY != null | ||
env: | ||
SSH_AUTH_SOCK: /tmp/ssh_agent.sock | ||
SSH_PRIVATE_KEY: ${{ secrets.DOWNLOADS_HOSTGATOR_DOT_MIXXX_DOT_ORG_KEY }} | ||
SSH_HOST: downloads-hostgator.mixxx.org | ||
run: | | ||
ssh-agent -a $SSH_AUTH_SOCK > /dev/null | ||
ssh-add - <<< "${SSH_PRIVATE_KEY}" | ||
mkdir -p "${HOME}/.ssh" | ||
ssh-keyscan "${SSH_HOST}" >> "${HOME}/.ssh/known_hosts" | ||
echo "SSH_AUTH_SOCK=${SSH_AUTH_SOCK}" >> "${GITHUB_ENV}" | ||
- name: Delete obsolete files | ||
if: env.SSH_AUTH_SOCK != null | ||
run: | | ||
mkdir empty_folder | ||
echo snapshots/build-checks-fix/* >> include_file.txt | ||
echo snapshots/build-checks-fix >> include_file.txt | ||
rsync --verbose --times --recursive --include-from=include_file.txt --exclude=* --delete "empty_folder/" "${SSH_USER}@${SSH_HOST}:${DESTDIR}/" | ||
env: | ||
DESTDIR: public_html/downloads | ||
SSH_HOST: downloads-hostgator.mixxx.org | ||
SSH_USER: mixxx |