-
Notifications
You must be signed in to change notification settings - Fork 5
69 lines (62 loc) · 2.55 KB
/
reprepro-manual.yaml
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
name: Manual Reprepro
on:
workflow_dispatch:
inputs:
command:
description: The command to run, excluding `reprepro -b debian`
required: true
type: string
deploy:
description: Whether to deploy changes back
required: false
type: boolean
default: true
# Protect reprepro database using concurrency
concurrency: reprepro
jobs:
reprepro:
name: Run reprepro
environment: packages.element.io
runs-on: ubuntu-latest
env:
R2_BUCKET: ${{ vars.R2_BUCKET }}
R2_DB_BUCKET: ${{ vars.R2_DB_BUCKET }}
R2_URL: ${{ vars.CF_R2_S3_API }}
steps:
- uses: actions/checkout@v3
- name: Load GPG key
uses: crazy-max/ghaction-import-gpg@111c56156bcc6918c056dbef52164cfa583dc549 # v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
fingerprint: ${{ vars.GPG_FINGERPRINT }}
- name: Install reprepro
run: sudo apt-get install -y reprepro
- name: Fetch database
run: aws s3 cp --recursive "s3://$R2_DB_BUCKET" debian/db/ --endpoint-url "$R2_URL" --region auto
env:
AWS_ACCESS_KEY_ID: ${{ secrets.CF_R2_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_TOKEN }}
- name: Run reprepro
run: |
reprepro -b debian ${{ inputs.command }}
- name: Deploy debian repo
if: inputs.deploy
run: |
aws s3 cp --recursive packages.element.io/debian/ "s3://$R2_BUCKET/debian" --endpoint-url "$R2_URL" --region auto
env:
AWS_ACCESS_KEY_ID: ${{ secrets.CF_R2_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_TOKEN }}
- name: Store database
if: inputs.deploy
run: aws s3 cp --recursive debian/db/ "s3://$R2_DB_BUCKET" --endpoint-url "$R2_URL" --region auto
env:
AWS_ACCESS_KEY_ID: ${{ secrets.CF_R2_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_TOKEN }}
- uses: actions/upload-artifact@v3
if: inputs.deploy == false
with:
name: packages.element.io
path: |
packages.element.io
debian