Skip to content

Keep Cache

Keep Cache #20

Workflow file for this run

name: Keep Cache
on:
workflow_dispatch:
schedule:
- cron: '0 0 */6 * *' # At 00:00 (midnight) every 6 days
env:
TZ: Asia/Shanghai
jobs:
keep:
runs-on: ubuntu-22.04
strategy:
matrix:
KERNEL_VERSION: ['5.15', 'latest', 'immortalwrt']
continue-on-error: true
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Set environment variables
run: |
echo "KERNEL_VERSION=${{ matrix.KERNEL_VERSION }}" >> $GITHUB_ENV
if [ "${{ matrix.KERNEL_VERSION }}" == "immortalwrt" ]; then
echo "REPO_URL=https://github.com/immortalwrt/immortalwrt" >> $GITHUB_ENV
echo "REPO_BRANCH=openwrt-23.05" >> $GITHUB_ENV
else
echo "REPO_URL=https://github.com/coolsnowwolf/lede" >> $GITHUB_ENV
echo "REPO_BRANCH=master" >> $GITHUB_ENV
fi
- name: Initialize environment
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo mkdir -p /workdir && sudo chown $USER:$GROUPS /workdir
- name: Clone source code
working-directory: /workdir
run: |
git clone ${{ env.REPO_URL }} -b ${{ env.REPO_BRANCH }} openwrt
ln -sf /workdir/openwrt $GITHUB_WORKSPACE/openwrt
- name: Cache build
uses: klever1988/cachewrtbuild@main
with:
ccache: 'true'
mixkey: 'armv8_${{ env.KERNEL_VERSION }}'
prefix: ${{ github.workspace }}/openwrt