mirror of
https://github.com/lan-tianxiang/clone_scripts.git
synced 2025-07-13 23:52:36 +08:00
Create sync_from_scf_github.yml
This commit is contained in:
51
.github/workflows/sync_from_scf_github.yml
vendored
Normal file
51
.github/workflows/sync_from_scf_github.yml
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
name: sync_from_scf_github
|
||||
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 '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
|
Reference in New Issue
Block a user