Weekly clean & rebuild #143
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
--- | |
name: Weekly clean & rebuild | |
on: | |
schedule: | |
- cron: '0 8 * * 6' | |
workflow_dispatch: | |
concurrency: | |
group: run-only-one-workflow | |
jobs: | |
build: | |
uses: ./.github/workflows/build.yml | |
with: | |
cacheless: true | |
deploy-cache: | |
name: Deploy cache on cache.dasharo.com | |
needs: build | |
runs-on: | |
labels: dts-builder | |
steps: | |
- name: Prepare SSH key | |
shell: bash | |
env: | |
SSH_KEY: ${{secrets.SSH_KEY}} | |
run: | | |
echo -e ${SSH_KEY} > ~/.ssh/dts-ci-key | |
chmod 600 ~/.ssh/dts-ci-key | |
- name: Send sstate-cache folder to cache.dasharo.com | |
shell: bash | |
run: | | |
ssh -i ~/.ssh/dts-ci-key builder@10.1.40.2 "mkdir -p cache/yocto/dts" | |
rsync -P -e "ssh -i ~/.ssh/dts-ci-key" -rlptD --delete build/sstate-cache builder@10.1.40.2:cache/yocto/dts | |
- name: Send downloads folder to cache.dasharo.com | |
shell: bash | |
run: | | |
rsync -P -e "ssh -i ~/.ssh/dts-ci-key" -rlptD --delete build/downloads builder@10.1.40.2:cache/yocto/dts | |
cleanup: | |
name: Cleanup | |
if: always() | |
needs: deploy-cache | |
runs-on: | |
labels: dts-builder | |
steps: | |
- name: Cleanup after deployment | |
shell: bash | |
run: | | |
rm -rf ~/.ssh/dts-ci-key | |
rm -rf build |