name: sync_clone_scripts_from_lxk_docker on: workflow_dispatch: schedule: - cron: '*/30 * * * *' jobs: sync: runs-on: ubuntu-18.04 if: github.repository == 'lan-tianxiang/clone_scripts' timeout-minutes: 2 steps: - name: Init Build Dependencies env: DEBIAN_FRONTEND: noninteractive run: | sudo -E rm -rf /etc/apt/sources.list.d sudo -E apt-get update -y sudo -E apt-get install -y build-essential git git-core curl wget jq sudo -E apt-get clean -y git config --global user.name 'lxk0301' && git config --global user.email 'lxk0301@gitee.com' - name: Get Code run: | docker pull lxk0301/jd_scripts:latest docker save lxk0301/jd_scripts:latest > jd.tar tar -xvf jd.tar layer_file=$(cat manifest.json | jq ".[0]" | jq ".Layers" | jq ".[1]" | sed 's,",,g') cp $layer_file ./ tar -xvf layer.tar - name: Push Master uses: ad-m/github-push-action@master with: directory: scripts github_token: ${{ secrets.HUB_TOKEN }} branch: master - name: Delete Workflow Runs uses: Mattraks/delete-workflow-runs@main with: token: ${{ github.token }} repository: ${{ github.repository }} retain_days: 1 keep_minimum_runs: 0