Skip to content

Commit dda465c

Browse files
authored
Merge pull request #287 from github/restore-workflow
Restoring with backup-utils action from ghes-data
2 parents 8aaccc3 + 7894a7b commit dda465c

File tree

1 file changed

+82
-0
lines changed

1 file changed

+82
-0
lines changed

.github/workflows/restore.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Restore Dataset
2+
run-name: ${{ github.actor }} retrieving data-sets
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
size:
7+
description: 'Size of the dataset to restore'
8+
required: true
9+
type: choice
10+
options:
11+
- 'small'
12+
- 'medium'
13+
hostname:
14+
description: 'Hostname of the server'
15+
required: true
16+
type: string
17+
ref:
18+
description: 'Branch ref to use'
19+
required: false
20+
type: string
21+
default: 'master'
22+
version:
23+
description: 'GHES Version of dataset'
24+
required: false
25+
type: string
26+
default: "3.8.0"
27+
workflow_call:
28+
inputs:
29+
size:
30+
description: 'Size of the dataset to restore'
31+
required: false
32+
type: string
33+
default: 'small'
34+
hostname:
35+
description: 'Hostname of the server'
36+
required: true
37+
type: string
38+
ref:
39+
description: 'Branch ref to use'
40+
required: false
41+
type: string
42+
default: 'master'
43+
version:
44+
description: 'GHES Version of dataset'
45+
required: false
46+
type: string
47+
default: "3.8.0"
48+
jobs:
49+
build:
50+
runs-on: ubuntu-latest
51+
steps:
52+
- uses: actions/checkout@v3
53+
with:
54+
repository: github/backup-utils-private
55+
ref: ${{ inputs.ref }}
56+
- run: docker build . --file Dockerfile --tag backup-utils
57+
- run: docker save backup-utils -o backup-utils.tar
58+
- uses: actions/upload-artifact@v3
59+
with:
60+
name: backup-utils
61+
path: backup-utils.tar
62+
restore:
63+
needs: build
64+
runs-on: ubuntu-latest
65+
env:
66+
SSH_KEY: ${{ secrets.BACKUP_SSH_KEY }}
67+
steps:
68+
- uses: actions/download-artifact@v3
69+
with:
70+
name: backup-utils
71+
- name: Load docker container
72+
run: docker load -i backup-utils.tar
73+
- uses: actions/checkout@v3
74+
with:
75+
repository: github/ghes-data
76+
ref: main
77+
- run: tar zxvf ghes-data/data/backup/${{ inputs.size }}/v3.8.0/${{ inputs.size }}-refined.tar.gz
78+
- run: ls -al ghes-data/data/backup/${{ inputs.size }}
79+
80+
81+
82+

0 commit comments

Comments
 (0)