-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (50 loc) · 1.91 KB
/
backup.yml
File metadata and controls
58 lines (50 loc) · 1.91 KB
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
name: Back up Public Repositories
on:
schedule:
- cron: "0 0 1 * *" # Runs at midnight on the first day of every month
workflow_dispatch:
jobs:
back-up:
runs-on: ubuntu-22.04
strategy:
matrix:
repo:
[
"https://github.com/cicd-excellence/app.git",
"https://github.com/cicd-excellence/infra.git",
"https://github.com/larose/cargo.git",
"https://github.com/larose/conjugueur.git",
"https://github.com/larose/eef.git",
"https://github.com/larose/ena.git",
"https://github.com/larose/git-backup-demo.git",
"https://github.com/larose/hnsync.git",
"https://github.com/larose/lynx.git",
"https://github.com/larose/pretty-printer.git",
"https://github.com/larose/tsp.git",
"https://github.com/larose/utt.git",
"https://github.com/larose/verbes.git",
"https://github.com/larose/yarn-monorepo-change-based-testing-demo.git",
"https://github.com/larose/wiki.git",
]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "lts/*"
- name: Install @larose/git-backup
run: npm install -g @larose/git-backup
- name: Back up ${{ matrix.repo }}
run: |
git-backup snapshot \
--repo ${{ matrix.repo }} \
--remote ${{ secrets.REMOTE }} \
--access-key-id ${{ secrets.ACCESS_KEY_ID }} \
--secret-access-key ${{ secrets.SECRET_ACCESS_KEY }}
git-backup prune \
--repo ${{ matrix.repo }} \
--remote ${{ secrets.REMOTE }} \
--access-key-id ${{ secrets.ACCESS_KEY_ID }} \
--secret-access-key ${{ secrets.SECRET_ACCESS_KEY }} \
--retention-policy "monthly=3"