This repository has been archived by the owner on Nov 14, 2024. It is now read-only.
forked from rpardini/armbian-git-shallow
-
-
Notifications
You must be signed in to change notification settings - Fork 2
99 lines (81 loc) · 2.95 KB
/
main-latest.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: "Make shallow bundles"
on:
workflow_dispatch:
push:
branches: [ main ]
schedule:
- cron: '0 3 * * *' # Scheduled runs every day at 3am UTC
jobs:
fake:
if: ${{ github.repository_owner == 'Armbian' }}
runs-on: ubuntu-latest
name: Generate control artefact
steps:
- run: |
echo "not empty" > changes
- uses: actions/upload-artifact@v3
with:
path: changes
name: changes
if-no-files-found: ignore
git-trees:
if: ${{ github.repository_owner == 'Armbian' }}
runs-on: ubuntu-latest
needs: [ fake ]
name: "GIT tree"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache git worktree
uses: actions/cache@v2
with:
path: /tmp/workdir/kernel/worktree
key: ${{ runner.os }}-kernel-worktree-${{ github.sha }}
restore-keys: |
${{ runner.os }}-kernel-worktree
- name: Prepare git trees, bulk of work
run: |
BASE_WORK_DIR="/tmp/workdir" bash shallow_kernel_tree.sh
- name: Install SSH key for storage
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.KEY_TORRENTS }}
known_hosts: ${{ secrets.KNOWN_HOSTS_UPLOAD }}
if_key_exists: replace
- name: "GH latest release"
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: false
title: "Linux shallow git trees"
files: |
/tmp/workdir/kernel/output/*.gitshallow
/tmp/workdir/kernel/output/*.gitbundle
/tmp/workdir/kernel/output/*.git.tar
- name: Upload firmware to release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: latest
body: "<p align='center'><a href='https://www.armbian.com'><img src='https://raw.githubusercontent.com/armbian/.github/master/profile/tux-two.png' width='400' height='226' alt='Armbian Linux'></a></p>"
files: /tmp/workdir/kernel/worktree/LICENSE
- name: Deploy to server
run: |
ls -l /tmp/workdir/kernel/output/
sudo apt-get -y -qq install lftp
lftp -u upload, -e "set net:timeout 4;set net:max-retries 6;mirror --Remove-source-files -R --no-empty-dirs --parallel=8 --no-perms /tmp/workdir/kernel/output/ gitbundles/ ;bye" sftp://users.armbian.com
sync-servers:
permissions:
contents: none
name: "Sync servers"
needs: [git-trees]
uses: armbian/scripts/.github/workflows/sync-servers.yml@master
with:
KEY_ID: 'upload'
secrets:
KEY_UPLOAD: ${{ secrets.KEY_UPLOAD }}
USER_REPOSITORY: ${{ secrets.USER_REPOSITORY }}
HOST_REPOSITORY: ${{ secrets.HOST_REPOSITORY }}
KNOWN_HOSTS_REPOSITORY: ${{ secrets.KNOWN_HOSTS_REPOSITORY }}