Files
clone_scripts_clone/.github/workflows/sync_from_scf_github.yml
2021-03-27 14:32:34 +08:00

52 lines
1.7 KiB
YAML

name: sync_from_scf_github
on:
workflow_dispatch:
schedule:
- cron: '*/30 * * * *'
jobs:
sync:
runs-on: ubuntu-latest
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 'GitHub Actions' && git config --global user.email 'noreply@github.com'
# - name: Get Code 01
# run: |
# mkdir -p ~/.ssh
# echo -e "${{ secrets.LXKEY }}" > ~/.ssh/id_rsa
# chmod 600 ~/.ssh/id_rsa
# ssh-keyscan gitee.com > ~/.ssh/known_hosts
# git clone -b master git@gitee.com:lxk0301/jd_scripts.git scripts
# - name: Get Code 02
# 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: Get Code 03
run: |
git clone -b master https://github.com/DoveBoy/scf.git scripts
- name: Push Code
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